Video coding method on basis of transformation, and device therefor

ABSTRACT

A video decoding method according to the present document comprises a step of deriving transform coefficients for a current block on the basis of residual information, wherein the step of deriving the transform coefficients comprises a step of deriving a zero-out block indicating a region in which effective transform coefficients may exist in the current block, wherein the zero-out block is derived on the basis of flag information indicating whether multiple transform selection (MTS), in which a plurality of transform kernels are used, can be applied to the current block.

BACKGROUND Technical Field

The present disclosure relates generally to an image coding technologyand, more particularly, to an image coding method based on a transformin an image coding system and an apparatus therefor.

Related Art

Nowadays, the demand for high-resolution and high-quality images/videossuch as 4K, 8K or more ultra high definition (UHD) images/videos hasbeen increasing in various fields. As the image/video data becomeshigher resolution and higher quality, the transmitted information amountor bit amount increases as compared to the conventional image data.Therefore, when image data is transmitted using a medium such as aconventional wired/wireless broadband line or image/video data is storedusing an existing storage medium, the transmission cost and the storagecost thereof are increased.

Further, nowadays, the interest and demand for immersive media such asvirtual reality (VR), artificial reality (AR) content or hologram, orthe like is increasing, and broadcasting for images/videos having imagefeatures different from those of real images, such as a game image isincreasing.

Accordingly, there is a need for a highly efficient image/videocompression technique for effectively compressing and transmitting orstoring, and reproducing information of high resolution and high qualityimages/videos having various features as described above.

SUMMARY

A technical aspect of the present disclosure is to provide a method andan apparatus for increasing image coding efficiency.

Another technical aspect of the present disclosure is to provide amethod and an apparatus for increasing residual coding efficiency.

Still another technical aspect of the present disclosure is to provide amethod and an apparatus for increasing residual coding efficiency bycoding a transform coefficient based on high-frequency zeroing.

Yet another technical aspect of the present disclosure is to provide amethod and an apparatus for increasing the efficiency of image coding inwhich high-frequency zeroing is performed based on a multiple transformselection.

Still another technical aspect of the present disclosure is to provide amethod and an apparatus for coding an image which are capable ofreducing data loss when performing high-frequency zeroing.

Yet another technical aspect of the present disclosure is to provide amethod and an apparatus for deriving a context model for lastsignificant transform coefficient position information based on acurrent block size when coding transform coefficients for a currentblock (or current transform block) based on high-frequency zeroing.

According to an embodiment of the present disclosure, there is providedan image decoding method performed by a decoding apparatus. The methodincludes deriving transform coefficients for a current block based onresidual information, wherein the deriving of the transform coefficientsincludes deriving a zero-out block indicating a region in which asignificant transform coefficient may exist in the current block, andthe zero-out block is derived based on flag information indicatingwhether a multiple transform selection (MTS) using a plurality oftransform kernels is applicable to the current block.

The width or height of the zero-out block may be set to 16 when the MTSis applied, and the width or height of the zero-out block may be set to32 or less when the MTS is not applied.

When flag information indicating whether a subblock transform forperforming transform on a partitioned coding unit is applied to thecurrent block is 1, the width or height of the zero-out block may be 16.

When the height of a partitioned subblock is less than 64 and the widthof the subblock is 32, the width of the zero-out block may be set to 16.

When the width of a partitioned subblock is less than 64 and the heightof the subblock is 32, the height of the zero-out block may be set to16.

The transform kernels may be derived based on the partition direction ofthe current block and the position of a subblock to which a transform isapplied.

The residual information may include last significant coefficient prefixinformation, and the maximum value of the last significant coefficientprefix information may be derived based on a size of the zero-out block.

According to another embodiment of the present disclosure, there isprovided an image encoding method performed by an encoding apparatus.The method includes deriving residual samples for a current block andderiving transform coefficients based on the residual samples for thecurrent block, wherein the deriving of the transform coefficients mayinclude deriving a zero-out block indicating a region in which asignificant transform coefficient may exist in the current block basedon whether a multiple transform selection (MTS) using a plurality oftransform kernels is applied to the current block.

According to still another embodiment of the present disclosure, theremay be provided a digital storage medium that stores image dataincluding encoded image information and a bitstream generated accordingto an image encoding method performed by an encoding apparatus.

According to yet another embodiment of the present disclosure, there maybe provided a digital storage medium that stores image data includingencoded image information and a bitstream to cause a decoding apparatusto perform the image decoding method.

According to the present disclosure, it is possible to increase overallimage/video compression efficiency.

According to the present disclosure, it is possible to increase theefficiency of residual coding.

According to the present disclosure, it is possible to increase theefficiency of residual coding by coding a transform coefficient based onhigh-frequency zeroing.

According to the present disclosure, it is possible to increase theefficiency of image coding in which high-frequency zeroing is performedbased on a multiple transform selection.

According to the present disclosure, it is possible to reduce data losswhen performing high-frequency zeroing, thereby increasing theefficiency of image coding.

The effects that can be obtained through specific examples of thepresent disclosure are not limited to the effects listed above. Forexample, there may be various technical effects that a person havingordinary skill in the related art can understand or derive from thepresent disclosure. Accordingly, specific effects of the presentdisclosure are not limited to those explicitly described in the presentdisclosure and may include various effects that can be understood orderived from the technical features of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically illustrates an example of a video/image codingsystem to which the present disclosure is applicable.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which the present disclosure isapplicable.

FIG. 3 is a diagram schematically illustrating a configuration of avideo/image decoding apparatus to which the present disclosure isapplicable

FIG. 4 schematically illustrates a multiple transform techniqueaccording to an embodiment of the present disclosure.

FIG. 5 illustrates an MTS applied to a subblock transform according toan example of the present disclosure.

FIG. 6 illustrates a 32-point zero-out applied to a subblock transformaccording to an example of the present disclosure.

FIG. 7 is a flowchart illustrating the operation of a video decodingapparatus according to an embodiment of the present disclosure.

FIG. 8 is a flowchart illustrating a process for deriving a transformcoefficient by a video decoding apparatus according to an embodiment ofthe present disclosure.

FIG. 9 is a flowchart illustrating the operation of a video encodingapparatus according to an embodiment of the present disclosure.

FIG. 10 is a flowchart illustrating a process for encoding a transformcoefficient and information by a video encoding apparatus according toan embodiment of the present disclosure.

FIG. 11 illustrates the structure of a content streaming system to whichthe present disclosure is applied.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

While the present disclosure may be susceptible to various modificationsand include various embodiments, specific embodiments thereof have beenshown in the drawings by way of example and will now be described indetail. However, this is not intended to limit the present disclosure tothe specific embodiments disclosed herein. The terminology used hereinis for the purpose of describing specific embodiments only, and is notintended to limit technical idea of the present disclosure. The singularforms may include the plural forms unless the context clearly indicatesotherwise. The terms such as “include” and “have” are intended toindicate that features, numbers, steps, operations, elements,components, or combinations thereof used in the following descriptionexist, and thus should not be understood as that the possibility ofexistence or addition of one or more different features, numbers, steps,operations, elements, components, or combinations thereof is excluded inadvance.

Meanwhile, each component on the drawings described herein isillustrated independently for convenience of description as tocharacteristic functions different from each other, and however, it isnot meant that each component is realized by a separate hardware orsoftware. For example, any two or more of these components may becombined to form a single component, and any single component may bedivided into plural components. The embodiments in which components arecombined and/or divided will belong to the scope of the patent right ofthe present disclosure as long as they do not depart from the essence ofthe present disclosure.

Hereinafter, preferred embodiments of the present disclosure will beexplained in more detail while referring to the attached drawings. Inaddition, the same reference signs are used for the same components onthe drawings, and repeated descriptions for the same components will beomitted.

This document relates to video/image coding. For example, themethod/example disclosed in this document may relate to a VVC (VersatileVideo Coding) standard (ITU-T Rec. H.266), a next-generation video/imagecoding standard after VVC, or other video coding related standards(e.g., HEVC (High Efficiency Video Coding) standard (ITU-T Rec. H.265),EVC (essential video coding) standard, AVS2 standard, etc.).

In this document, a variety of embodiments relating to video/imagecoding may be provided, and, unless specified to the contrary, theembodiments may be combined to each other and be performed.

In this document, a video may mean a set of a series of images overtime. Generally a picture means a unit representing an image at aspecific time zone, and a slice/tile is a unit constituting a part ofthe picture. The slice/tile may include one or more coding tree units(CTUs). One picture may be constituted by one or more slices/tiles. Onepicture may be constituted by one or more tile groups. One tile groupmay include one or more tiles.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component. Alternatively, the sample mayrefer to a pixel value in the spatial domain, or when this pixel valueis converted to the frequency domain, it may refer to a transformcoefficient in the frequency domain.

A unit may represent the basic unit of image processing. The unit mayinclude at least one of a specific region and information related to theregion. One unit may include one luma block and two chroma (e.g., cb,cr) blocks. The unit and a term such as a block, an area, or the likemay be used in place of each other according to circumstances. In ageneral case, an M×N block may include a set (or an array) of samples(or sample arrays) or transform coefficients consisting of M columns andN rows.

In this document, the term “/” and “,” should be interpreted to indicate“and/or.” For instance, the expression “A/B” may mean “A and/or B.”Further, “A, B” may mean “A and/or B.” Further, “A/B/C” may mean “atleast one of A, B, and/or C.” Also, “A/B/C” may mean “at least one of A,B, and/or C.”

Further, in the document, the term “or” should be interpreted toindicate “and/or.” For instance, the expression “A or B” may include 1)only A, 2) only B, and/or 3) both A and B. In other words, the term “or”in this document should be interpreted to indicate “additionally oralternatively.”

In the present disclosure, “at least one of A and B” may mean “only A”,“only B”, or “both A and B”. In addition, in the present disclosure, theexpression “at least one of A or B” or “at least one of A and/or B” maybe interpreted as “at least one of” A and B.

In addition, in the present disclosure, “at least one of A, B, and C”may mean “only A”, “only B”, “only C”, or “any combination of A, B, andC”. In addition, “at least one of A, B, or C” or “at least one of A, B,and/or C” may mean “at least one of” A, B, and C.

In addition, a parenthesis used in the present disclosure may mean “forexample”. Specifically, when indicated as “prediction (intraprediction)”, it may mean that “intra prediction” is proposed as anexample of “prediction”. That is, “prediction” in the present disclosureis not limited to “intra prediction”, and “intra prediction” may beproposed as an example of “prediction”. In addition, when indicated as“prediction (i.e., intra prediction)”, it may also mean that “intraprediction” is proposed as an example of “prediction”.

Technical features individually described in one figure in the presentdisclosure may be individually implemented or may be simultaneouslyimplemented.

FIG. 1 schematically illustrates an example of a video/image codingsystem to which the present disclosure is applicable.

Referring to FIG. 1, the video/image coding system may include a firstdevice (source device) and a second device (receive device). The sourcedevice may deliver encoded video/image information or data in the formof a file or streaming to the receive device via a digital storagemedium or network.

The source device may include a video source, an encoding apparatus, anda transmitter. The receive device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may obtain a video/image through a process ofcapturing, synthesizing, or generating a video/image. The video sourcemay include a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, or the like. The video/image generating device mayinclude, for example, a computer, a tablet and a smartphone, and may(electronically) generate a video/image. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode an input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compression and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded video/image information or dataoutput in the form of a bitstream to the receiver of the receive devicethrough a digital storage medium or a network in the form of a file orstreaming. The digital storage medium may include various storagemediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like. Thetransmitter may include an element for generating a media file through apredetermined file format, and may include an element for transmissionthrough a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received/extractedbitstream to the decoding apparatus.

The decoding apparatus may decode a video/image by performing a seriesof procedures such as dequantization, inverse transform, prediction, andthe like corresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which the present disclosure isapplicable. Hereinafter, what is referred to as the video encodingapparatus may include an image encoding apparatus.

Referring to FIG. 2, the encoding apparatus 200 may include an imagepartitioner 210, a predictor 220, a residual processor 230, an entropyencoder 240, an adder 250, a filter 260, and a memory 270. The predictor220 may include an inter predictor 221 and an intra predictor 222. Theresidual processor 230 may include a transformer 232, a quantizer 233, adequantizer 234, an inverse transformer 235. The residual processor 230may further include a subtractor 231. The adder 250 may be called areconstructor or reconstructed block generator. The image partitioner210, the predictor 220, the residual processor 230, the entropy encoder240, the adder 250, and the filter 260, which have been described above,may be constituted by one or more hardware components (e.g., encoderchipsets or processors) according to an embodiment. Further, the memory270 may include a decoded picture buffer (DPB), and may be constitutedby a digital storage medium. The hardware component may further includethe memory 270 as an internal/external component.

The image partitioner 210 may partition an input image (or a picture ora frame) input to the encoding apparatus 200 into one or more processingunits. As one example, the processing unit may be called a coding unit(CU). In this case, starting with a coding tree unit (CTU) or thelargest coding unit (LCU), the coding unit may be recursivelypartitioned according to the Quad-tree binary-tree ternary-tree (QTBTTT)structure. For example, one coding unit may be divided into a pluralityof coding units of a deeper depth based on the quad-tree structure, thebinary-tree structure, and/or the ternary structure. In this case, forexample, the quad-tree structure may be applied first and thebinary-tree structure and/or the ternary structure may be applied later.Alternatively, the binary-tree structure may be applied first. Thecoding procedure according to the present disclosure may be performedbased on the final coding unit which is not further partitioned. In thiscase, the maximum coding unit may be used directly as a final codingunit based on coding efficiency according to the image characteristic.Alternatively, the coding unit may be recursively partitioned intocoding units of a further deeper depth as needed, so that the codingunit of an optimal size may be used as a final coding unit. Here, thecoding procedure may include procedures such as prediction, transform,and reconstruction, which will be described later. As another example,the processing unit may further include a prediction unit (PU) or atransform unit (TU), In this case, the prediction unit and the transformunit may be split or partitioned from the above-described final codingunit. The prediction unit may be a unit of sample prediction, and thetransform unit may be a unit for deriving a transform coefficient and/ora unit for deriving a residual signal from a transform coefficient.

The unit and a term such as a block, an area, or the like may be used inplace of each other according to circumstances. In a general case, anM×N block may represent a set of samples or transform coefficientsconsisting of M columns and N rows. The sample may generally represent apixel or a value of a pixel, and may represent only a pixel/pixel valueof a luma component, or only a pixel/pixel value of a chroma component.The sample may be used as a term corresponding to a pixel or a pel ofone picture (or image).

The subtractor 231 subtracts a prediction signal (predicted block,prediction sample array) output from the inter predictor 221 or theintra predictor 222 from an input image signal (original block, originalsample array) to generate a residual signal (residual block, residualsample array), and the generated residual signal is transmitted to thetransformer 232. In this case, as shown, a unit which subtracts theprediction signal (predicted block, prediction sample array) from theinput image signal (original block, original sample array) in theencoder 200 may be called the subtractor 231. The predictor may performprediction on a processing target block (hereinafter, referred to as‘current block’), and may generate a predicted block includingprediction samples for the current block. The predictor may determinewhether intra prediction or inter prediction is applied on a currentblock or CU basis. As discussed later in the description of eachprediction mode, the predictor may generate various information relatingto prediction, such as prediction mode information, and transmit thegenerated information to the entropy encoder 240. The information on theprediction may be encoded in the entropy encoder 240 and output in theform of a bitstream.

The intra predictor 222 may predict the current block by referring tosamples in the current picture. The referred samples may be located inthe neighbor of or apart from the current block according to theprediction mode. In the intra prediction, prediction modes may include aplurality of non-directional modes and a plurality of directional modes.The non-directional modes may include, for example, a DC mode and aplanar mode. The directional mode may include, for example, 33directional prediction modes or 65 directional prediction modesaccording to the degree of detail of the prediction direction. However,this is merely an example, and more or less directional prediction modesmay be used depending on a setting. The intra predictor 222 maydetermine the prediction mode applied to the current block by using theprediction mode applied to the neighboring block.

The inter predictor 221 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. At this time, in order to reducethe amount of motion information transmitted in the inter predictionmode, the motion information may be predicted on a block, subblock, orsample basis based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block existing in the current picture and a temporalneighboring block existing in the reference picture. The referencepicture including the reference block and the reference pictureincluding the temporal neighboring block may be same to each other ordifferent from each other. The temporal neighboring block may be calleda collocated reference block, a collocated CU (colCU), and the like, andthe reference picture including the temporal neighboring block may becalled a collocated picture (colPic). For example, the inter predictor221 may configure a motion information candidate list based onneighboring blocks and generate information indicating which candidateis used to derive a motion vector and/or a reference picture index ofthe current block. Inter prediction may be performed based on variousprediction modes. For example, in the case of a skip mode and a mergemode, the inter predictor 221 may use motion information of theneighboring block as motion information of the current block. In theskip mode, unlike the merge mode, the residual signal may not betransmitted. In the case of the motion information prediction (motionvector prediction, MVP) mode, the motion vector of the neighboring blockmay be used as a motion vector predictor and the motion vector of thecurrent block may be indicated by signaling a motion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods. For example, the predictor may apply intraprediction or inter prediction for prediction on one block, and, aswell, may apply intra prediction and inter prediction at the same time.This may be called combined inter and intra prediction (CIIP). Further,the predictor may be based on an intra block copy (IBC) prediction mode,or a palette mode in order to perform prediction on a block. The IBCprediction mode or palette mode may be used for content image/videocoding of a game or the like, such as screen content coding (SCC).Although the IBC basically performs prediction in a current block, itcan be performed similarly to inter prediction in that it derives areference block in a current block. That is, the IBC may use at leastone of inter prediction techniques described in the present disclosure.

The prediction signal generated through the inter predictor 221 and/orthe intra predictor 222 may be used to generate a reconstructed signalor to generate a residual signal. The transformer 232 may generatetransform coefficients by applying a transform technique to the residualsignal. For example, the transform technique may include at least one ofa discrete cosine transform (DCT), a discrete sine transform (DST), aKarhunen-Loeve transform (KLT), a graph-based transform (GBT), or aconditionally non-linear transform (CNT). Here, the GBT means transformobtained from a graph when relationship information between pixels isrepresented by the graph. The CNT refers to transform obtained based ona prediction signal generated using all previously reconstructed pixels.In addition, the transform process may be applied to square pixel blockshaving the same size or may be applied to blocks having a variable sizerather than the square one.

The quantizer 233 may quantize the transform coefficients and transmitthem to the entropy encoder 240, and the entropy encoder 240 may encodethe quantized signal (information on the quantized transformcoefficients) and output the encoded signal in a bitstream. Theinformation on the quantized transform coefficients may be referred toas residual information. The quantizer 233 may rearrange block typequantized transform coefficients into a one-dimensional vector formbased on a coefficient scan order, and generate information on thequantized transform coefficients based on the quantized transformcoefficients of the one-dimensional vector form. The entropy encoder 240may perform various encoding methods such as, for example, exponentialGolomb, context-adaptive variable length coding (CAVLC),context-adaptive binary arithmetic coding (CABAC), and the like. Theentropy encoder 240 may encode information necessary for video/imagereconstruction other than quantized transform coefficients (e.g. valuesof syntax elements, etc.) together or separately. Encoded information(e.g., encoded video/image information) may be transmitted or stored ona unit basis of a network abstraction layer (NAL) in the form of abitstream. The video/image information may further include informationon various parameter sets such as an adaptation parameter set (APS), apicture parameter set (PPS), a sequence parameter set (SPS), a videoparameter set (VPS) or the like. Further, the video/image informationmay further include general constraint information. In the presentdisclosure, information and/or syntax elements which aretransmitted/signaled to the decoding apparatus from the encodingapparatus may be included in video/image information. The video/imageinformation may be encoded through the above-described encodingprocedure and included in the bitstream. The bitstream may betransmitted through a network, or stored in a digital storage medium.Here, the network may include a broadcast network, a communicationnetwork and/or the like, and the digital storage medium may includevarious storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, andthe like. A transmitter (not shown) which transmits a signal output fromthe entropy encoder 240 and/or a storage (not shown) which stores it maybe configured as an internal/external element of the encoding apparatus200, or the transmitter may be included in the entropy encoder 240.

Quantized transform coefficients output from the quantizer 233 may beused to generate a prediction signal. For example, by applyingdequantization and inverse transform to quantized transform coefficientsthrough the dequantizer 234 and the inverse transformer 235, theresidual signal (residual block or residual samples) may bereconstructed. The adder 155 adds the reconstructed residual signal to aprediction signal output from the inter predictor 221 or the intrapredictor 222, so that a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array) may be generated. Whenthere is no residual for a processing target block as in a case wherethe skip mode is applied, the predicted block may be used as areconstructed block. The adder 250 may be called a reconstructor or areconstructed block generator. The generated reconstructed signal may beused for intra prediction of a next processing target block in thecurrent block, and as described later, may be used for inter predictionof a next picture through filtering.

Meanwhile, in the picture encoding and/or reconstructing process, lumamapping with chroma scaling (LMCS) may be applied.

The filter 260 may improve subjective/objective video quality byapplying the filtering to the reconstructed signal. For example, thefilter 260 may generate a modified reconstructed picture by applyingvarious filtering methods to the reconstructed picture, and may storethe modified reconstructed picture in the memory 270, specifically inthe DPB of the memory 270. The various filtering methods may include,for example, deblocking filtering, sample adaptive offset, an adaptiveloop filter, a bilateral filter or the like. As discussed later in thedescription of each filtering method, the filter 260 may generatevarious information relating to filtering, and transmit the generatedinformation to the entropy encoder 240. The information on the filteringmay be encoded in the entropy encoder 240 and output in the form of abitstream.

The modified reconstructed picture which has been transmitted to thememory 270 may be used as a reference picture in the inter predictor221. Through this, the encoding apparatus can avoid prediction mismatchin the encoding apparatus 100 and a decoding apparatus when the interprediction is applied, and can also improve coding efficiency.

The memory 270 DPB may store the modified reconstructed picture in orderto use it as a reference picture in the inter predictor 221. The memory270 may store motion information of a block in the current picture, fromwhich motion information has been derived (or encoded) and/or motioninformation of blocks in an already reconstructed picture. The storedmotion information may be transmitted to the inter predictor 221 to beutilized as motion information of a neighboring block or motioninformation of a temporal neighboring block. The memory 270 may storereconstructed samples of reconstructed blocks in the current picture,and transmit them to the intra predictor 222.

FIG. 3 is a diagram schematically illustrating a configuration of avideo/image decoding apparatus to which the present disclosure isapplicable.

Referring to FIG. 3, the video decoding apparatus 300 may include anentropy decoder 310, a residual processor 320, a predictor 330, an adder340, a filter 350 and a memory 360. The predictor 330 may include aninter predictor 331 and an intra predictor 332. The residual processor320 may include a dequantizer 321 and an inverse transformer 321. Theentropy decoder 310, the residual processor 320, the predictor 330, theadder 340, and the filter 350, which have been described above, may beconstituted by one or more hardware components (e.g., decoder chipsetsor processors) according to an embodiment. Further, the memory 360 mayinclude a decoded picture buffer (DPB), and may be constituted by adigital storage medium. The hardware component may further include thememory 360 as an internal/external component.

When a bitstream including video/image information is input, thedecoding apparatus 300 may reconstruct an image correspondingly to aprocess by which video/image information has been processed in theencoding apparatus of FIG. 2. For example, the decoding apparatus 300may derive units/blocks based on information relating to block partitionobtained from the bitstream. The decoding apparatus 300 may performdecoding by using a processing unit applied in the encoding apparatus.Therefore, the processing unit of decoding may be, for example, a codingunit, which may be partitioned along the quad-tree structure, thebinary-tree structure, and/or the ternary-tree structure from a codingtree unit or a largest coding unit. One or more transform units may bederived from the coding unit. And, the reconstructed image signaldecoded and output through the decoding apparatus 300 may be reproducedthrough a reproducer.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (e.g.,video/image information) required for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), a video parameter set (VPS) or the like. Further, the video/imageinformation may further include general constraint information. Thedecoding apparatus may decode a picture further based on information onthe parameter set and/or the general constraint information. In thepresent disclosure, signaled/received information and/or syntaxelements, which will be described later, may be decoded through thedecoding procedure and be obtained from the bitstream. For example, theentropy decoder 310 may decode information in the bitstream based on acoding method such as exponential Golomb encoding, CAVLC, CABAC, or thelike, and may output a value of a syntax element necessary for imagereconstruction and quantized values of a transform coefficient regardinga residual. More specifically, a CABAC entropy decoding method mayreceive a bin corresponding to each syntax element in a bitstream,determine a context model using decoding target syntax elementinformation and decoding information of neighboring and decoding targetblocks, or information of symbol/bin decoded in a previous step, predictbin generation probability according to the determined context model andperform arithmetic decoding of the bin to generate a symbolcorresponding to each syntax element value. Here, the CABAC entropydecoding method may update the context model using information of asymbol/bin decoded for a context model of the next symbol/bin afterdetermination of the context model. Information on prediction amonginformation decoded in the entropy decoder 310 may be provided to thepredictor (inter predictor 332 and intra predictor 331), and residualvalues, that is, quantized transform coefficients, on which entropydecoding has been performed in the entropy decoder 310, and associatedparameter information may be input to the residual processor 320. Theresidual processor 320 may derive a residual signal (residual block,residual samples, residual sample array). Further, information onfiltering among information decoded in the entropy decoder 310 may beprovided to the filter 350. Meanwhile, a receiver (not shown) whichreceives a signal output from the encoding apparatus may furtherconstitute the decoding apparatus 300 as an internal/external element,and the receiver may be a component of the entropy decoder 310.Meanwhile, the decoding apparatus according to the present disclosuremay be called a video/image/picture coding apparatus, and the decodingapparatus may be classified into an information decoder(video/image/picture information decoder) and a sample decoder(video/image/picture sample decoder). The information decoder mayinclude the entropy decoder 310, and the sample decoder may include atleast one of the dequantizer 321, the inverse transformer 322, the adder340, the filter 350, the memory 360, the inter predictor 332, and theintra predictor 331.

The dequantizer 321 may output transform coefficients by dequantizingthe quantized transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in the form of a two-dimensionalblock. In this case, the rearrangement may perform rearrangement basedon an order of coefficient scanning which has been performed in theencoding apparatus. The dequantizer 321 may perform dequantization onthe quantized transform coefficients using quantization parameter (e.g.,quantization step size information), and obtain transform coefficients.

The deqauntizer 322 obtains a residual signal (residual block, residualsample array) by inverse transforming transform coefficients.

The predictor may perform prediction on the current block, and generatea predicted block including prediction samples for the current block.The predictor may determine whether intra prediction or inter predictionis applied to the current block based on the information on predictionoutput from the entropy decoder 310, and specifically may determine anintra/inter prediction mode.

The predictor may generate a prediction signal based on variousprediction methods. For example, the predictor may apply intraprediction or inter prediction for prediction on one block, and, aswell, may apply intra prediction and inter prediction at the same time.This may be called combined inter and intra prediction (CIIP). Inaddition, the predictor may perform intra block copy (IBC) forprediction on a block. The intra block copy may be used for contentimage/video coding of a game or the like, such as screen content coding(SCC). Although the IBC basically performs prediction in a currentblock, it can be performed similarly to inter prediction in that itderives a reference block in a current block. That is, the IBC may useat least one of inter prediction techniques described in the presentdisclosure.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighbor of or apart from the current block according to theprediction mode. In the intra prediction, prediction modes may include aplurality of non-directional modes and a plurality of directional modes.The intra predictor 331 may determine the prediction mode applied to thecurrent block by using the prediction mode applied to the neighboringblock.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. At this time, in order to reducethe amount of motion information transmitted in the inter predictionmode, the motion information may be predicted on a block, subblock, orsample basis based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block existing in the current picture and a temporalneighboring block existing in the reference picture. For example, theinter predictor 332 may configure a motion information candidate listbased on neighboring blocks, and derive a motion vector and/or areference picture index of the current block based on received candidateselection information. Inter prediction may be performed based onvarious prediction modes, and the information on prediction may includeinformation indicating a mode of inter prediction for the current block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) by adding theobtained residual signal to the prediction signal (predicted block,prediction sample array) output from the predictor 330. When there is noresidual for a processing target block as in a case where the skip modeis applied, the predicted block may be used as a reconstructed block.

The adder 340 may be called a reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for intraprediction of a next processing target block in the current block, andas described later, may be output through filtering or be used for interprediction of a next picture.

Meanwhile, in the picture decoding process, luma mapping with chromascaling (LMCS) may be applied.

The filter 350 may improve subjective/objective video quality byapplying the filtering to the reconstructed signal. For example, thefilter 350 may generate a modified reconstructed picture by applyingvarious filtering methods to the reconstructed picture, and may transmitthe modified reconstructed picture in the memory 360, specifically inthe DPB of the memory 360. The various filtering methods may include,for example, deblocking filtering, sample adaptive offset, an adaptiveloop filter, a bilateral filter or the like.

The (modified) reconstructed picture which has been stored in the DPB ofthe memory 360 may be used as a reference picture in the inter predictor332. The memory 360 may store motion information of a block in thecurrent picture, from which motion information has been derived (ordecoded) and/or motion information of blocks in an already reconstructedpicture. The stored motion information may be transmitted to the interpredictor 260 to be utilized as motion information of a neighboringblock or motion information of a temporal neighboring block. The memory360 may store reconstructed samples of reconstructed blocks in thecurrent picture, and transmit them to the intra predictor 331.

In this specification, the examples described in the predictor 330, thedequantizer 321, the inverse transformer 322, and the filter 350 of thedecoding apparatus 300 may be similarly or correspondingly applied tothe predictor 220, the dequantizer 234, the inverse transformer 235, andthe filter 260 of the encoding apparatus 200, respectively.

As described above, prediction is performed in order to increasecompression efficiency in performing video coding. Through this, apredicted block including prediction samples for a current block, whichis a coding target block, may be generated. Here, the predicted blockincludes prediction samples in a space domain (or pixel domain). Thepredicted block may be identically derived in the encoding apparatus andthe decoding apparatus, and the encoding apparatus may increase imagecoding efficiency by signaling to the decoding apparatus not originalsample value of an original block itself but information on residual(residual information) between the original block and the predictedblock. The decoding apparatus may derive a residual block includingresidual samples based on the residual information, generate areconstructed block including reconstructed samples by adding theresidual block to the predicted block, and generate a reconstructedpicture including reconstructed blocks.

The residual information may be generated through transform andquantization procedures. For example, the encoding apparatus may derivea residual block between the original block and the predicted block,derive transform coefficients by performing a transform procedure onresidual samples (residual sample array) included in the residual block,and derive quantized transform coefficients by performing a quantizationprocedure on the transform coefficients, so that it may signalassociated residual information to the decoding apparatus (through abitstream). Here, the residual information may include valueinformation, position information, a transform technique, transformkernel, a quantization parameter or the like of the quantized transformcoefficients. The decoding apparatus may perform aquantization/dequantization procedure and derive the residual samples(or residual sample block), based on residual information. The decodingapparatus may generate a reconstructed block based on a predicted blockand the residual block. The encoding apparatus may derive a residualblock by dequantizing/inverse transforming quantized transformcoefficients for reference for inter prediction of a next picture, andmay generate a reconstructed picture based on this.

FIG. 4 schematically illustrates a multiple transform techniqueaccording to an embodiment of the present disclosure.

Referring to FIG. 4, a transformer may correspond to the transformer inthe foregoing encoding apparatus of FIG. 2, and an inverse transformermay correspond to the inverse transformer in the foregoing encodingapparatus of FIG. 2, or to the inverse transformer in the decodingapparatus of FIG. 3.

The transformer may derive (primary) transform coefficients byperforming a primary transform based on residual samples (residualsample array) in a residual block (S410). This primary transform may bereferred to as a core transform. Herein, the primary transform may bebased on multiple transform selection (MTS), and when a multipletransform is applied as the primary transform, it may be referred to asa multiple core transform.

The multiple core transform may represent a method of transformingadditionally using discrete cosine transform (DCT) type 2 and discretesine transform (DST) type 7, DCT type 8, and/or DST type 1. That is, themultiple core transform may represent a transform method of transforminga residual signal (or residual block) of a space domain into transformcoefficients (or primary transform coefficients) of a frequency domainbased on a plurality of transform kernels selected from among the DCTtype 2, the DST type 7, the DCT type 8 and the DST type 1. Herein, theprimary transform coefficients may be called temporary transformcoefficients from the viewpoint of the transformer.

That is, when the conventional transform method is applied, transformcoefficients may be generated by applying transform from a space domainto a frequency domain to a residual signal (or residual block) based onDCT type 2. However, when the multiple core transform is applied,transform coefficients (or primary transform coefficients) may begenerated by applying transform from a space domain to a frequencydomain to a residual signal (or residual block) based on DCT type 2, DSTtype 7, DCT type 8, and/or DST type 1. Here, DCT type 2, DST type 7, DCTtype 8, and DST type 1 may be referred to as transform types, transformkernels, or transform cores. These DCT/DST types may be defined based onbasis functions.

If the multiple core transform is performed, then a vertical transformkernel and a horizontal transform kernel for a target block may beselected from among the transform kernels, a vertical transform for thetarget block may be performed based on the vertical transform kernel,and a horizontal transform for the target block may be performed basedon the horizontal transform kernel. Here, the horizontal transform mayrepresent a transform for horizontal components of the target block, andthe vertical transform may represent a transform for vertical componentsof the target block. The vertical transform kernel/horizontal transformkernel may be adaptively determined based on a prediction mode and/or atransform index of a target block (CU or sub-block) including a residualblock.

Further, according to an example, if the primary transform is performedby applying the MTS, a mapping relationship for transform kernels may beset by setting specific basis functions to predetermined values andcombining basis functions to be applied in the vertical transform or thehorizontal transform. For example, when the horizontal transform kernelis expressed as trTypeHor and the vertical direction transform kernel isexpressed as trTypeVer, a trTypeHor or trTypeVer value of 0 may be setto DCT2, a trTypeHor or trTypeVer value of 1 may be set to DST-7, and atrTypeHor or trTypeVer value of 2 may be set to DCT-8.

In this case, MTS index information may be encoded and signaled to thedecoding apparatus to indicate any one of a plurality of transformkernel sets. For example, an MTS index of 0 may indicate that bothtrTypeHor and trTypeVer values are 0, an MTS index of 1 may indicatethat both trTypeHor and trTypeVer values are 1, an MTS index of 2 mayindicate that the trTypeHor value is 2 and the trTypeVer value. Is 1, anMTS index of 3 may indicate that the trTypeHor value is 1 and thetrTypeVer value is 2, and an MTS index of 4 may indicate that both bothtrTypeHor and trTypeVer values are 2.

In one example, transform kernel sets according to MTS index informationare illustrated in the following table.

TABLE 1 tu_mts_idx[ x0 ][ y0 ] 0 1 2 3 4 trTypeHor 0 1 2 1 2 trTypeVer 01 1 2 2

The transformer may derive modified (secondary) transform coefficientsby performing the secondary transform based on the (primary) transformcoefficients (S420). The primary transform is a transform from a spatialdomain to a frequency domain, and the secondary transform refers totransforming into a more compressive expression by using a correlationexisting between (primary) transform coefficients. The secondarytransform may include a non-separable transform. In this case, thesecondary transform may be called a non-separable secondary transform(NSST), or a mode-dependent non-separable secondary transform (MDNSST).The non-separable secondary transform may represent a transform whichgenerates modified transform coefficients (or secondary transformcoefficients) for a residual signal by secondary-transforming, based ona non-separable transform matrix, (primary) transform coefficientsderived through the primary transform. At this time, the verticaltransform and the horizontal transform may not be applied separately (orhorizontal and vertical transforms may not be applied independently) tothe (primary) transform coefficients, but the transforms may be appliedat once based on the non-separable transform matrix. In other words, thenon-separable secondary transform may represent a transform method inwhich the vertical and horizontal components of the (primary) transformcoefficients are not separated, and for example, two-dimensional signals(transform coefficients) are re-arranged to a one-dimensional signalthrough a certain determined direction (e.g., row-first direction orcolumn-first direction), and then modified transform coefficients (orsecondary transform coefficients) are generated based on thenon-separable transform matrix. For example, according to a row-firstorder, M×N blocks are disposed in a line in an order of a first row, asecond row, . . . , and an Nth row. According to a column-first order,M×N blocks are disposed in a line in an order of a first column, asecond column, . . . , and an Nth column. The non-separable secondarytransform may be applied to a top-left region of a block configured with(primary) transform coefficients (hereinafter, may be referred to as atransform coefficient block). For example, if the width (W) and theheight (H) of the transform coefficient block are all equal to orgreater than 8, an 8×8 non-separable secondary transform may be appliedto a top-left 8×8 region of the transform coefficient block. Further, ifthe width (W) and the height (H) of the transform coefficient block areall equal to or greater than 4, and the width (W) or the height (H) ofthe transform coefficient block is less than 8, then a 4×4 non-separablesecondary transform may be applied to a top-left min(8, W)×min(8, H)region of the transform coefficient block. However, the embodiment isnot limited to this, and for example, even if only the condition thatthe width (W) or height (H) of the transform coefficient block is equalto or greater than 4 is satisfied, the 4×4 non-separable secondarytransform may be applied to the top-left min(8, W)×min(8, H) region ofthe transform coefficient block.

The transformer may perform the non-separable secondary transform basedon the selected transform kernels, and may obtain modified (secondary)transform coefficients. As described above, the modified transformcoefficients may be derived as transform coefficients quantized throughthe quantizer, and may be encoded and signaled to the decoding apparatusand transferred to the dequantizer/inverse transformer in the encodingapparatus.

Meanwhile, as described above, if the secondary transform is omitted,(primary) transform coefficients, which are an output of the primary(separable) transform, may be derived as transform coefficientsquantized through the quantizer as described above, and may be encodedand signaled to the decoding apparatus and transferred to thedequantizer/inverse transformer in the encoding apparatus.

The inverse transformer may perform a series of procedures in theinverse order to that in which they have been performed in theabove-described transformer. The inverse transformer may receive(dequantized) transformer coefficients, and derive (primary) transformcoefficients by performing a secondary (inverse) transform (S450), andmay obtain a residual block (residual samples) by performing a primary(inverse) transform on the (primary) transform coefficients (S460). Inthis connection, the primary transform coefficients may be calledmodified transform coefficients from the viewpoint of the inversetransformer. As described above, the encoding apparatus and the decodingapparatus may generate the reconstructed block based on the residualblock and the predicted block, and may generate the reconstructedpicture based on the reconstructed block.

The decoding apparatus may further include a secondary inverse transformapplication determinator (or an element to determine whether to apply asecondary inverse transform) and a secondary inverse transformdeterminator (or an element to determine a secondary inverse transform).The secondary inverse transform application determinator may determinewhether to apply a secondary inverse transform. For example, thesecondary inverse transform may be an NSST or an RST, and the secondaryinverse transform application determinator may determine whether toapply the secondary inverse transform based on a secondary transformflag obtained by parsing the bitstream. In another example, thesecondary inverse transform application determinator may determinewhether to apply the secondary inverse transform based on a transformcoefficient of a residual block.

The secondary inverse transform determinator may determine a secondaryinverse transform. In this case, the secondary inverse transformdeterminator may determine the secondary inverse transform applied tothe current block based on an NSST (or RST) transform set specifiedaccording to an intra prediction mode. In an embodiment, a secondarytransform determination method may be determined depending on a primarytransform determination method. Various combinations of primarytransforms and secondary transforms may be determined according to theintra prediction mode. Further, in an example, the secondary inversetransform determinator may determine a region to which a secondaryinverse transform is applied based on the size of the current block.

Meanwhile, as described above, if the secondary (inverse) transform isomitted, (dequantized) transform coefficients may be received, theprimary (separable) inverse transform may be performed, and the residualblock (residual samples) may be obtained. As described above, theencoding apparatus and the decoding apparatus may generate thereconstructed block based on the residual block and the predicted block,and may generate the reconstructed picture based on the reconstructedblock.

Meanwhile, in the present disclosure, a reduced secondary transform(RST) in which the size of a transform matrix (kernel) is reduced may beapplied in the concept of NSST in order to reduce the amount ofcomputation and memory required for the non-separable secondarytransform.

Meanwhile, the transform kernel, the transform matrix, and thecoefficient constituting the transform kernel matrix, that is, thekernel coefficient or the matrix coefficient, described in the presentdisclosure may be expressed in 8 bits. This may be a condition forimplementation in the decoding apparatus and the encoding apparatus, andmay reduce the amount of memory required to store the transform kernelwith a performance degradation that can be reasonably accommodatedcompared to the existing 9 bits or 10 bits. In addition, the expressingof the kernel matrix in 8 bits may allow a small multiplier to be used,and may be more suitable for single instruction multiple data (SIMD)instructions used for optimal software implementation.

In the present specification, the term “RST” may mean a transform whichis performed on residual samples for a target block based on a transformmatrix whose size is reduced according to a reduced factor. In the caseof performing the reduced transform, the amount of computation requiredfor transform may be reduced due to a reduction in the size of thetransform matrix. That is, the RST may be used to address thecomputational complexity issue occurring at the non-separable transformor the transform of a block of a great size.

RST may be referred to as various terms, such as reduced transform,reduced secondary transform, reduction transform, simplified transform,simple transform, and the like, and the name which RST may be referredto as is not limited to the listed examples. Alternatively, since theRST is mainly performed in a low frequency region including a non-zerocoefficient in a transform block, it may be referred to as aLow-Frequency Non-Separable Transform (LFNST).

Meanwhile, when the secondary inverse transform is performed based onRST, the inverse transformer 235 of the encoding apparatus 200 and theinverse transformer 322 of the decoding apparatus 300 may include aninverse reduced secondary transformer which derives modified transformcoefficients based on the inverse RST of the transform coefficients, andan inverse primary transformer which derives residual samples for thetarget block based on the inverse primary transform of the modifiedtransform coefficients. The inverse primary transform refers to theinverse transform of the primary transform applied to the residual. Inthe present disclosure, deriving a transform coefficient based on atransform may refer to deriving a transform coefficient by applying thetransform.

Hereinafter, a reduced multiple transform technique (reduced adaptivemultiple selection (or set) (RMTS)) is described.

As described above, when combinations of a plurality of transforms(DCT-2, DST-7, DCT-8, DST-1, DCT-5, and the like) are selectively usedfor a primary transform in a multiple transform technique (multipletransform set or adaptive multiple transform), the transform may beapplied only to a predefined area to reduce complexity rather thanperforming the transform for all cases, thereby remarkably reducingcomplexity in the worst case.

For example, when the primary transform is applied to an M×M pixel blockbased on the foregoing reduced transform (RT) method, only calculationfor a transform block of an R×R block (M>=R) may be performed instead ofobtaining an M×M transform block. Consequently, non-zero coefficientsexist only in an R×R region, and transform coefficients in the otherregion may be considered as zero without being calculated. The followingtable shows three examples of a reduced adaptive multiple transform(RAMT) using a reduced transform factor (R) value predefined for thesize of a block to which the primary transform is applied.

TABLE 2 Transform Reduced Reduced Reduced size transform 1 transform 2transform 3 8 × 8 4 × 4 6 × 6 6 × 6 16 × 16 8 × 8 12 × 12 8 × 8 32 × 3216 × 16 16 × 16 16 × 16 64 × 64 32 × 32 16 × 16 16 × 16 128 × 128 32 ×32 16 × 16 16 × 16

According to an example, in applying the reduced multiple transformsillustrated above, the reduced transform factor may be determined basedon the primary transform. For example, when the primary transform isDCT2, calculation is simple compared to other primary transforms, andthus a reduced transform may not be used for a small block or arelatively large R value may be used for a small block, therebyminimizing a decrease in coding performance. For example, differentreduced transform factors may be used for DCT2 and other transforms asfollows.

TABLE 3 Transform Reduced Reduced size transform for DCT2 transformexcept DCT2 8 × 8 8 × 8 4 × 4 16 × 16 16 × 16 8 × 8 32 × 32 32 × 32 16 ×16 64 × 64 32 × 32 32 × 32 128 × 128 32 × 32 32 × 32

As shown in Table 3, when the primary transform is DCT2, the size of thetransform is not changed when the size of a block to be transformed is8×8 or 16×16, and the reduced size of the transform is limited to 32×32when the size of the block is 32×32 or greater.

Alternatively, according to an example, when a flag value indicatingwhether an MTS is applied is 0 (i.e., when DCT2 is applied for bothhorizontal and vertical directions), only 32 coefficients from the leftand the top may be left and high-frequency components may be zeroed out,that is, set to 0 s, for both (horizontal and vertical) directions(zero-out embodiment 1).

For example, in a 64×64 transform unit (TU), transform coefficients areleft only in a top-left 32×32 region, in a 64×16 TU, transformcoefficients are left only in a top-left 32×16 region, and in an 8×64TU, transform coefficients are left only in a top-left 8×32 region. Thatis, transform coefficients exist corresponding to only up to a maximumlength of 32 in both width and height.

This zero-out method may be applied only to a residual signal to whichintra prediction is applied or may be applied only to a residual signalto which inter prediction is applied. Alternatively, the zero-out methodmay be applied to both a residual signal to which intra prediction isapplied and a residual signal to which inter prediction is applied.

A change of the transform block size, which can be expressed as theforegoing zero-out or high-frequency zeroing, refers to a process ofzeroing (determining as 0 s) transform coefficients related to a highfrequency of a certain value or greater in a (transform) block having afirst width (or length) of W1 and a first height (or length) of H1. Whenhigh-frequency zeroing is applied, the transform coefficient values ofall transform coefficients outside a low-frequency transform coefficientregion configured based on a second width of W2 and a second height ofH2 among transform coefficients in the (transform) block may bedetermined (set) as 0 s. The outside of the low-frequency transformcoefficient region may be referred to as a high-frequency transformcoefficient region. In an example, the low-frequency transformcoefficient region may be a rectangular region positioned from thetop-left of the (transform) block.

That is, high-frequency zeroing may be defined as setting all transformcoefficients at a position defined by an x coordinate of w or greaterand a y coordinate of h or greater to 0 s where the horizontal xcoordinate value of the top-left position of the current transform block(TB) is set to 0 and the vertical y coordinate value thereof is set to 0(and where x coordinates increase from left to right and y coordinatesincrease downwards).

In the present disclosure, a specific term or expression for definingspecific information or concept is used. For example, as describedabove, in the present specification, a process of zeroing transformcoefficients corresponding to a frequency of a certain value or greaterin a (transform) block having a first width (or length) of W1 and afirst height (or length) of H1 is defined as “high-frequency zeroing”, aregion that has been subjected to zeroing through the high-frequencyzeroing is defined as a “high-frequency transform coefficient region”,and a region that has not been subjected to the zeroing is defined as a“low-frequency transform coefficient region”. To indicate the size ofthe low-frequency transform coefficient region, a second width (orlength) of W2 and a second height (or length) of H2 are used.

However, “high-frequency zeroing” may be replaced by various terms, suchas high frequency zeroing, high frequency zeroing-out, high-frequencyzeroing-out, high-frequency zero-out, and zero-out, and a“high-frequency transform coefficient region” may be replaced by variousterms, such as a high-frequency zeroing-applied region, a high-frequencyzeroing region, a high-frequency region, a high-frequency coefficientregion, a high-frequency zero-out region, and a zero-out region, and a“low-frequency transform coefficient region” may be replaced by variousterms, such as a high-frequency zeroing-unapplied region, alow-frequency region, a low-frequency coefficient region, and arestricted region. Thus, a specific term or expression used herein todefine specific information or concept needs to be interpretedthroughout the specification in view of various operations, functions,and effects according to content indicated by the term without beinglimited to the designation.

Alternatively, according to an example, a low-frequency transformcoefficient region refers to a region remaining after performinghigh-frequency zeroing or a region in which a significant transformcoefficient is left, that is, a region in which a non-zero transformcoefficient may exist, and may be referred to as a zero-out region or azero-out block.

According to an example, when the flag value indicating whether the MTSis applied is 1, that is, when a different transform (DST-7 or DCT-8)other than DCT2 is applicable for the horizontal direction and thevertical direction, transform coefficients may be left only in atop-left region and the remaining region may be zeroed out as follows(zero-out embodiment 2).

-   -   When the width (w) is equal to or greater than 2^(n), only        transform coefficients corresponding to a length of w/2^(p) from        the left may be left and remaining transform coefficients may be        fixed to 0 s (zeroed out).    -   When the height (h) is equal to or greater than 2^(m), only        transform coefficients corresponding to a length of h/2^(q) from        the top and remaining transform coefficients may be fixed to 0 s        (zeroed out).

Here, m, n, p, and q may be integers equal to or greater than 0, and maybe specifically as follows.

-   -   1) (m, n, p, q)=(5, 5, 1, 1)    -   2) (m, n, p, q)=(4, 4, 1, 1)

In configuration 1), transform coefficients remain only in a top-left16×16 region in a 32×16 TU, and transform coefficients remain only in atop-left 8×16 region in an 8×32 TU.

This zero-out method may be applied only to a residual signal to whichintra prediction is applied or may be applied only to a residual signalto which inter prediction is applied. Alternatively, the zero-out methodmay be applied to both a residual signal to which intra prediction isapplied and a residual signal to which inter prediction is applied.

Alternatively, according to another example, when the flag valueindicating whether the MTS is applied is 1, that is, when a differenttransform (DST-7 or DCT-8) other than DCT2 is applicable for thehorizontal direction and the vertical direction, transform coefficientsmay be left only in a top-left region and the remaining region may bezeroed out as follows (zero-out embodiment 3).

-   -   When the height (h) is equal to or greater than the width (w)        and is equal to or greater than 2^(n), only transform        coefficients in a top-left w×(h/2^(p)) region may be left and        remaining transform coefficients may be fixed to 0 s (zeroed        out).    -   When the width (w) is greater than the height (h) and is equal        to or greater than 2^(m), only transform coefficients in a        top-left (w/2^(q))×h region and remaining transform coefficients        may be fixed to 0 s (zeroed out).

In the above conditions, when the height (h) and the width (w) are thesame, a vertical length is reduced (h/2p), but a horizontal length maybe reduced (w/2q).

Here, m, n, p, and q may be integers equal to or greater than 0, and maybe specifically as follows.

-   -   1) (m, n, p, q)=(4, 4, 1, 1)    -   2) (m, n, p, q)=(5, 5, 1, 1)

In configuration 1), transform coefficients remain only in a top-left16×16 region in a 32×16 TU, and transform coefficients remain only in atop-left 8×8 region in an 8×16 TU.

This zero-out method may be applied only to a residual signal to whichintra prediction is applied or may be applied only to a residual signalto which inter prediction is applied. Alternatively, the zero-out methodmay be applied to both a residual signal to which intra prediction isapplied and a residual signal to which inter prediction is applied.

In the foregoing embodiments, a transform coefficient region is limiteddepending on where the flag value indicating whether the MTS is appliedis 0 or where the flag value indicating whether the MTS is applied is 1.According to one example, combinations of these embodiments arepossible.

-   -   1) Zero-out embodiment 1+zero-out embodiment 2    -   2) Zero-out embodiment 1+zero-out embodiment 3

As mentioned in zero-out embodiment 2 and zero-out embodiment 3, thezero-out method may be applied only to a residual signal to which intraprediction is applied or may be applied only to a residual signal towhich inter prediction is applied. Alternatively, the zero-out methodmay be applied to both a residual signal to which intra prediction isapplied and a residual signal to which inter prediction is applied.Therefore, when an MTS flag is 1, the following table may be configured(when the MTS flag is 1, zero-out embodiment 1 may be applied). Here,the MTS flag may also be configured as an MTS index indicating atransform kernel for the MTS. For example, an MTS index of 0 mayindicate that zero-out embodiment 1 is applied.

TABLE 4 Config. initra prediction Inter prediction index residualsignals residual signals 1 Zero-out is not applied Zero-out is notapplied 2 Zero-out is not applied Zero out embodiment 2 3 Zero-out isnot applied Zero out embodiment 3 4 Zero out embodiment 2 Zero-out isnot applied 5 Zero out embodiment 2 Zero out embodiment 3 6 Zero outembodiment 2 Zero out embodiment 3 7 Zero out embodiment 3 Zero-out isnot applied 8 Zero out embodiment 3 Zero out embodiment 2 9 Zero outembodiment 3 Zero out embodiment 3

In zero-out embodiment 1, zero-out embodiment 2, and zero-out embodiment3, a region inevitably including a value of 0 in a TU is clearlydefined. That is, a region other than a top-left region, in which atransform coefficient is allowed to exist, is zeroed out. Accordingly,according to an embodiment, it may be configured to bypass a region inwhich a transform coefficient definitely has a value of 0 as a result ofentropy coding of a residual signal, rather than performing residualcoding thereon. For example, the following configuration is possible.

1) In HEVC or VVC, a flag indicating whether a non-zero transformcoefficient exists in one coefficient group (CG, which may be a 4×4 or2×2 block depending on the shapes of a subblock and a TU block and aluma component/chroma component) is coded (subblock_flag). Only whensubblock_flag is 1, the inside of the CG is scanned and coefficientlevel values are coded. Accordingly, for CGs belonging to a region thatzero-out is performed, subblock_flag may be set to a value of 0 bydefault rather than being coded.

2) In HEVC or VVC, the position of the last coefficient(last_coefficient_position_x in an X direction andlast_coefficient_position_y in a Y direction) in a forward scan order iscoded first. Generally, last_coefficient_position_x andlast_coefficient_position_y may have a maximum value of (width of aTU-1) and a maximum value of (height of the TU-1), respectively.However, when a region in which a non-zero coefficient may exist islimited due to zero-out, the maximum values oflast_coefficient_position_x and last_coefficient_position_yare alsolimited. Accordingly, the maximum values of last_coefficient_position_xand last_coefficient_position_y may be limited in view of zero-out andmay then be coded. For example, when a binarization method applied tolast_coefficient_position_x and last_coefficient_position_y is truncatedunary binarization, the maximum length of a truncated unary code(codeword length that last_coefficient_position_x andlast_coefficient_position_y can have) may be reduced based on adjustedmaximum values.

As described above, when the zero-out is applied, particularly in a casewhere the top-left 16×16 region is a low-frequency transform coefficientregion (which may be referred to as a 32-point reduced MTS or RMT 32hereinafter), the zero-out may be applied both when the MTS technique isapplied and when 32-point DST-7 or 32-point DCT-8 is applied.

FIG. 5 illustrates an MTS applied to a subblock transform according toan example of the present disclosure.

According to an example, a subblock transform (SBT) in which a codingunit is partitioned into subblocks and a transform process is performedon the subblocks may be applied. The subblock transform is applied to aresidual signal generated through inter prediction, and the residualsignal block is partitioned into two partitioned subblocks and aseparable transform is applied to only one of the subblocks according tothe subblock transform. The subblocks may divide in the horizontaldirection or the vertical direction, and the width or height of thepartitioned subblocks may be ½ or ¼ of the coding unit. When thesubblock transform is applied, since only one of the two partitionedsubblocks is transformed, residual data exists only in the transformedsubblock and no residual data exists in the remaining one subblock.

When either the width of the subblock to which the transform is appliedor the height thereof is 64 or greater, DCT-2 may be applied in both thehorizontal direction and the vertical direction, and when both the widthof the subblock to which the transform is applied and the height thereofare 32 or less, DST-7 or DCT-8 may be applied. Therefore, when the SBTis applied, a zero-out may be performed by applying RMTS32 only when allof two sides of the subblock to which the transform is applied have alength of 32 or less. That is, DST-7 or DCT-8 with a length of 32 orless may be applied in each direction (horizontal and verticaldirections), thereby leaving up to 16 transform coefficients for eachrow or column.

As shown in FIG. 5, when a block is divided and a transform is appliedto region A, DST-7 or DCT-8 may be applied to each side and a transformpair applied in the horizontal and vertical directions is not limited toan example illustrated in FIG. 5. In FIG. 5, the width and height of theentire block are denoted by w and h, respectively, and the width andheight of a block to which a separable transform is actually applied areexpressed as a pair of (width, height), which is (w1, h) or (w, h1). w1may be ½ or ¼ of w, and h1 may also be ½ or ¼ of h.

The block to which the transform is applied may be positioned on theleft or right or on the top or bottom in the entire block as shown inFIG. 5. Further, the block of FIG. 5 may be a residual signal generatedby inter prediction. A flag indicating whether to apply a transform toonly one subblock of the residual signal partitioned as shown in FIG. 5may be signaled, and when the flag is 1, a flag indicating whether theblock is vertically partitioned or horizontally partitioned as shown inFIG. 5 may also be set through signaling.

A flag indicating whether block A to which the transform is actuallyapplied is positioned on the left or right in the entire block or a flagindicating whether block A is positioned on the top or bottom may alsobe signaled.

As illustrated in FIG. 5, when a horizontal transform and a verticaltransform are determined for a specific block rather than specifying ahorizontal transform and a vertical transform by MTS signaling, RMTS32proposed above may be applied to each side when the respective sides inthe horizontal direction and the vertical direction have a length of 32.In RMTS32, residual coding may be omitted for a zero-out region, orresidual coding may be performed by scanning only a non-zero-out region.

FIG. 6 illustrates a 32-point zero-out applied to a subblock transformaccording to an example of the present disclosure.

When RMTS32 is applied to a subblock partitioned as shown in FIG. 5,residual data may exist as shown in FIG. 6 after the transform. That is,FIG. 6 shows that RMTS32 is applied to the subblock on which thetransform is performed among the blocks partitioned according toapplication of the subblock transform.

The width and height of block A to which the transform is actuallyapplied may be w/2 and h/2 or w/4 and h/4, respectively, relative to thewidth w and the height h of the original transform block.

In summary, RMTS32 may be applied to any block to which the transform isapplied if DST-7 or DCT-8 having a length of 32 is applicable in each ofthe horizontal and vertical directions. Whether DST-7 or DCT-8 having alength of 32 is applied may be determined through preset signaling ormay be determined without signaling according to a predetermined codingcondition.

In a case where the MTS is disabled (e.g., in VVC, the MTS may bedisabled when “sps_mts_enable_flag” is set to 0 in a sequence parameterset), when the SBT is applied, DCT-2 is applied in both the horizontaldirection and the vertical direction rather than a combination of DST-7and DCT-8 presented in Table 3.

Therefore, when the MTS is disabled, even though the block to betransformed is partitioned into subblocks, RMTS32 needs to be preventedfrom being applied. As described above, when the MTS is not applied,DCT-2 rather than DST-7 or DCT-8 may be applied in a primary transform,and a top-left block in which a non-zero transform coefficient to whichDCT-2 is applied may exist may be subjected to high-frequencyzeroing-out of reducing the width and height to 32. That is, thetop-left block in which the non-zero transform coefficient to whichinverse DCT-2 is applied may exist may be reduced in width and height to32 but is not zeroed out to a width and height of less than 32. This isto prevent data loss due to the zero-out, and the width or height of thetop-left block to which inverse DCT-2 is applied is not reduced to 16.

If the MTS is disabled, it is necessary to explicitly check the width orheight of the partitioned subblock to which DCT-2 is applied so that thewidth or height of the partitioned subblock is not reduced to 16.

According to an example, by determining “sps_mts_enabled_flag” inresidual coding syntax, it may be configured not to perform a zero-outdue to RMTS32 when the SBT is applied.

Specification text in which the foregoing embodiments are reflected maybe shown in the following tables (Table 5 to Table 15).

TABLE 5 7 Syntax and semantics ...... 7.3 Syntax in tubular form ......7.3.2 Raw byte sequence payloads, trailing bits and byte alignmentsyntax ...... 7.3.2.3 Sequence parameter set RBSP syntaxseq_parameter_set_rbsp( ) { Descriptor  ...... u(1) sps_transform_skip_enabled_flag u(1) ......  sps_mts_enabled_flag u(1) if( sps_mts_enabled_flag ) {   sps_explicit_mts_intra_enabled_flag u(1)  sps_explicit_mts_inter_enabled_flag u(1)  }  sps_sbt_enabled_flag u(1) if( sps_sbt_enabled_flag )   sps_sbt_max_size_64_flag u(1)  ...... }

TABLE 6 7.4 Semantics ...... 7.4.3 Raw byte sequence payloads, trailingbits and byte alignment semantics ...... 7.4.3.3 Sequence parameter setRBSP semantics ...... sps_transform_skip_enabled_flag equa to 1specifies that transform_skip_flag may be present in the transform unitsyntax. sps_transform_skip_enabled_flag equal to 0 specifies thattransform_skip_flag is not present in the transform unit syntax ......sps_mts_enabled_flag equal to 1 specifies thatsps_explicit_mts_intra_enabled_flag is present in the sequence parameterset RBSP syntax and that sps_explicit_mts_inter_enabled_flag is presentin the sequence parameter set RBSP syntax. sps_mts_enabled_flag equal to0 specifies that sps_explicit_mts_intra_enabled_flag is not present inthe sequence parameter set RBSP syntax and thatsps_explicit_mts_inter_enabled_flag is not present in the sequenceparameter set RBSP syntax. sps_explicit_mts_intra_enabled_flag equal to1 specifies that tu_mts_idx may be present in the transform unit syntaxfor intra coding units. sps_explicit_mts_intra_enabled_flag equal to 0specifies that tu_mts_idx is not present in the transform unit syntaxfor intra coding units. When not present, the value ofsps_explicit_mts_intra_enabled_flag is inferred to be equal to 0.sps_explicit_mts_inter_enabled_flag equal to 1 specifies that tu_mts_idxmay be present in the transform unit syntax for inter coding units.sps_explicit_mts_inter_enabled_flag equal to 0 specifies that tu_mts_idxis not present in the transform unit syntax for inter coding units. Whennot present, the value of sps_explicit_mts_inter_enabled_flag isinferred to be equal to 0. sps_sbt_enabled_flag equal to 0 specifiesthat subblock transform for inter-predicted CUs is disabled.sps_sbt_enabled_flag equal to 1 specifies that subblock transform forinter-predicteds CU is enabled. sps_sbt_max_size_64_flag equal to 0specifies that the maximum CU width and height for allowing subblocktransform is 32 luma samples. sps_sbt_max_size_64_flag equal to 1specifies that the maximum CU width and height for allowing subblocktransform is 64 luma samples. MaxSbtSize = Min( MaxTbSizeY,sps_sbt_max_size_64_flag ? 64 : 32) (7-32)

Table 5 and Table 6 include image information signaled in a sequenceparameter set for image coding and include pieces of flag informationrelated to a transform.

sps_transform_skip_enabled_flag specifies whether a transform skip isapplied, that is, whether a transform skip flag (transform_skip_flag)may be present in transform unit syntax.

sps_mts_enabled_flag is flag information specifying whether an MTS, thatis, a multiple transform selection technique, may be explicitly used.sps_mts_enabled_flag equal to 1 specifies thatsps_explicit_mts_intra_enabled_flag andsps_explicit_mts_inter_enabled_flag are present in sequence parameterset syntax.

When either one of sps_explicit_mts_intra_enabled_flag andsps_explicit_mts_inter_enabled_flag is 1, it is specified that the MTSmay be applied to the transform unit, which means that tu_mts_idx mayexist in the transformation unit syntax. For example, whensps_mts_enabled_flag is equal to 1 andsps_explicit_mts_intra_enabled_flag is equal to 0, an implicit MTS maybe applied to an intra coding unit.

sps_sbt_enabled_flag is flag information specifying whether theforegoing subblock transform may be applied to a coding unit for interprediction.

When sps_sbt_enabled_flag is equal to 1, sps_sbt_max_size_64_flag forthe maximum width and height of a coding unit for allowing the subblocktransform may be signaled.

When sps_sbt_max_size_64_flag is equal to 0, and the maximum width andheight of a coding unit for allowing a block transform is 32, and whensps_sbt_max_size_64_flag is equal to 1, the maximum width and height ofthe coding unit for allowing the subblock transform is derived to beequal to 64.

TABLE 7 7.3.2.4 Picture parameter set RBSP syntaxpic_parameter_set_rbsp( ) { Descriptor  ...... se(v)  if(sps_transform_skip_enabled_flag )   log2_transform_skip_max_size_minus2ue(v)  ...... } 7.4.3.4 Picture parameter set RBSP semantics ......log2_transform_skip_max_size_minus2 specifies the maximum block sizeused for transform skip, and shall be in the range of 0 to 3. When notpresent, the value of log2_transform_skip_max_size_minus2 is inferred tobe equal to 0. The variable MaxTsSize is set equal to 1 << (log2_transform_skip_max_size_minus2 + 2 ).

Table 7 shows transform-related information signaled in a pictureparameter set. log 2_transform_skip_max_size_minus2 is information forderiving a maximum block size used for a transform skip, and the maximumblock size used for the transform skip is derived to a value of log2_transform_skip_max_size_minus2 plus 2 to the power of 2 (1<<(log2_transform_skip_max_size_minus2+2).

TABLE 8 7.3.8.5 Coding unit syntax coding_unit( x0, y0, cbWidth,cbHeight, treeType ) { Descriptor  ......  if( CuPredMode[ chType ][ x0][ y0 ] != MODE_INTRA && !pred_mode_plt_flag &&  general_merge_flag[x0][y0] == 0 )   cu_cbf ae(v)  if( cu_cbf ) {   if(CuPredMode[ chType ][ x0 ][ y0 ] = = MODE_INTER && sps_sbt_enabled_flag   && !ciip_flag[ x0 ][ y0 ]&& !MergeTriangleFlag[ x0 ][ y0 ]) {    if(cbWidth <= MaxSbtSize && cbHeight <= MaxSbtSize ) {     allowSbtVerH =cbWidth >= 8     allowSbtVerQ = cbWidth >= 16     allowSbtHorH =cbHeight >= 8     allowSbtHorQ = cbHeight >= 16     if( allowSbtVerH | |allowSbtHorH | | allowSbtVerQ | | allowSbtHorQ )      cu_sbt_flag ae(v)   }    if( cu_sbt_flag ) {     if( ( allowSbtVerH | | allowSbtHorH) &&( allowSbtVerQ | | allowSbtHorQ) )      cu_sbt_quad_flag ae(v)     if( (cu_sbt_quad_flag && allowSbtVerQ && allowSbtHorQ ) | |       (!cu_sbt_quad_flag && allowSbtVerH && allowSbtHorH ) )      cu_sbt_horizontal_flag ae(v)      cu_sbt_pos_flag ae(v)   } } LfnstDcOnly = 1  LfnstZeroOutSigCoeffFlag = 1  transform_tree( x0, y0,cbWidth, cbHeight, treeType )  lfnstWidth = ( treeType = =DUAL_TREE_CHROMA) ? cbWidth / Sub WidthC        : cbWidth  lfnstHeight =( treeType = = DUAL_TREE_CHROMA ) ? cbHeight / SubHeightC        :cbHeight  if( Min( lfnstWidth, lfnstHeight ) >= 4&&sps_lfnst_enabled_flag = = 1&&   CuPredMode[ chType ][ x0 ][ y0 ] = =MODE_INTRA &&   IntraSubPartitionsSplitType = = ISP_NO_SPLIT &&   (!intra_mip_flag[ x0 ][ y0 ] | | Min( lfnstWidth, lfnstHeight ) >= 16) &&  tu_mts_idx[ x0 ][ y0 ] = = && Max( cbWidth, cbHeight ) <= MaxTbSizeY){   if( LfnstDcOnly = = 0 &&LfnstZeroOutSigCoeffFlag = = 1 )      lfnst_idx[ x0 ][ y0 ] ae(v)  }

TABLE 9 7.4.9 Slice data semantics ...... 7.4.9.5 Coding unit semantics...... cu_sbt_flag equal to 1 specifies that for the current codingunit, subblock transform is used. cu_sbt_flag equal to 0 specifies thatfor the current coding unit, subblock transform is not used. Whencu_sbt_flag is not present, its value is inferred to be equal to 0.NOTE - : When subblock transform is used, a coding unit is split intotwo transform units; one transform unit has residual data, the otherdoes not have residual data. cu_sbt_quad_flag equal to 1 specifies thatfor the current coding unit, the subblock transform includes a transformunit of ¼ size of the current coding unit. cu_sbt_quad_flag equal to 0specifies that for the current coding unit the subblock transformincludes a transform unit of ½ size of the current coding unit. Whencu_sbt_quad_flag is not present, its value is inferred to be equal to 0.cu_sbt_horizontal_flag equal to 1 specifies that the current coding unitis split horizontally into 2 transform units. cu_sbt_horizontal_flag[ x0][ y0 ] equal to 0 specifies that the current coding unit is splitvertically into 2 transform units. When cu_sbt_horizontal_flag is notpresent, its value is derived as follows: - If cu_sbt_quad_flag is equalto 1, cu_sbt_horizontal_flag is set to be equal to allowSbtHorQ. -Otherwise (cu_sbt_quad_flag is equal to 0), cu_sbt_horizontal_flag isset to be equal to   allowSbtHorH.   cu_sbt_pos_flag equal to 1specifies that the tu_cbf_luma, tu_cbf_cb and tu_cbf_cr of the firsttransform unit in the current coding unit are not present in thebitstream. cu_sbt_pos_flag equal to 0 specifies that the tu_cbf_luma,tu_cbf_cb and tu_cbf_cr of the second transform unit in the currentcoding unit are not present in the bitstream. The variableSbtNumFourthsTb0 is derived as follows: sbtMinNumFourths =cu_sbt_quad_flag ? 1 : 2 (7-151) SbtNumFourthsTb0 = cu_sbt_pos_flag ? (4 - sbtMinNumFourths) : sbtMinNumFourths (7-152)

Table 8 and Table 9 show syntax and semantics for the coding unit towhich inter prediction is applied, and a partition shape to which theSBT is applied may be determined by four syntax elements of Table 8.

cu_sbt_flag specifies whether the SBT is applied to the coding unit, andcu_sbt_quad_flag is flag information specifying whether a block to whichthe transform is applied is ¼ of the entire block when one coding unitis partitioned into two partitioned blocks. When cu_sbt_quad_flag isequal to 0, the partitioned subblock has a size of ½ of the width orheight of the coding unit, and when cu_sbt_quad_flag is equal to 1, thepartitioned subblock has a size of ¼ of the width or height of thecoding unit. When the width of the coding unit is w and the heightthereof is h, the height of the partitioned block may be h1=(¼)×h or thewidth thereof may be w1=(¼)×w.

cu_sbt_horizontal_flag equal to 1 specifies that the coding unit ispartitioned widthwise, that is, in the horizontal direction, andcu_sbt_horizontal_flag equal to 0 specifies that the coding unit ispartitioned lengthwise, that is, in the vertical direction.

When cu_sbt_pos_flag value is equal to 0, the transform is applied tothe upper subblock among the subblocks partitioned in the horizontaldirection, and the transform is applied to the left subblock among thesubblocks partitioned in the vertical direction. When cu_sbt_pos_flagvalue is equal to 1, the transform is applied to the lower subblockamong the subblocks partitioned in the horizontal direction, and thetransform is applied to the right subblock among the subblockspartitioned in the vertical direction.

The following table shows trTypeHor and trTypeVer according tocu_sbt_horizontal_flag and cu_sbt_pos_flag.

TABLE 10 cu_sbt_horizontal_flag cu_sbt_pos_flag trTypeHor trTypeVer 0 02 1 0 1 1 1 1 0 1 2 1 1 1 1

As described above, when trTypeHor denotes a horizontal transform kerneland trTypeVer denotes a horizontal transform kernel, a trTypeHor ortrTypeVer value of 0 may be set for DCT-2, a trTypeHor or trTypeVervalue of 1 may be set for DST-7, and a trTypeHor or trTypeVer value of 2may be set for DCT-8. Therefore, when the length of at least one side ofthe partitioned block to which the transform is applied is 64 orgreater, DCT-2 may be applied in both the horizontal direction and thevertical direction; otherwise, DST-7 or DCT-8 may be applied. When thecurrent block is partitioned and the transform is performed on thesubblock, the MTS may be implicitly applied as shown in Table 10.

When both the width and the height of the subblock are 32 or less andthus DST-7 or DCT-8 is applied, that is, when the MTS is applied to thesubblock, the foregoing RMTS may be applied. For example, the length ofthe subblock in each direction is 32, only 16 transform coefficients maybe left by applying DST-7 or DCT-8 with a length of 32.

However, when either the width or the height of the subblock is 64 orgreater, DCT-2 may be applied in both the horizontal direction and thevertical direction, and only 32 transform coefficients may be leftaccording to a high-frequency zero-out rather than applying the RMTS ineach direction.

TABLE 11 7.3.8.10 Transform unit syntax transform_unit( x0, y0, tbWidth,tbHeight, treeType, subTuIndex, chType) { Descriptor . . .  if(tu_cbf_luma[ x0 ][ y0 ] && treeType != DUAL_TREE_CHROMA   && ( tbWidth<= 32) && ( tbHeight <= 32)   && ( IntraSubPartitionsSplit[ x0 ][ y0 ] == ISP_NO_SPLIT ) && ( !cu_sbt_flag ) ) {   if(sps_transform_skip_enabled_flag && !BdpcmFlag[ x0 ][ y0 ]&&     tbWidth<= MaxTsSize && tbHeight <= MaxTsSize )     transform_skip_flag[ x0 ][y0 ] ae(v)    if( ( ( CuPredMode[ chType ][ x0 ][ y0 ] = = MODE_INTER &&    sps_explicit_mts_inter_enabled_flag )     | | ( CuPredMode[ chType][ x0 ][ y0 ] = = MODE_INTRA &&     sps_explicit_mts_intra_enabled_flag) )&& ( !transform_skip_flag[ x0 ][ y0 ] ) )     tu_mts_idx[ x0 ][ y0 ]ae(v)  }  if( tu_cbf_luma[ x0 ][ y0 ] ) {   if( !transform_skip_flag[ x0][ y0 ] )     residual_coding( x0, y0, Log2( tbWidth ), Log2( tbHeight), 0 )    else     residual_ts_coding( x0, y0, Log2( tbWidth ), Log2(tbHeight ), 0 )  }  if( tu_cbf_cb[ x0 ][ y0 ] )   residual_coding( xC,yC, Log2( wC ), Log2( hC ), 1 )  if( tu_cbf_cr[ x0 ][ y0 ]&&   !(tu_cbf_cb[ x0 ][ y0 ] && tu_joint_cbcr_residual_flag[ x0 ][ y0 ] )) {  residual_coding( xC, yC, Log2( wC ), Log2( hC ), 2 )  } } 7.4.9.10Transform unit semantics ...... transform_skip_flag[ x0 ][ y0 ]specifieswhether a transform is applied to the luma transform block or not. Thearray indices x0, y0 specify the location ( x0, y0 ) of the top- leftluma sample of the considered transform block relative to the top-leftluma sample of the picture. transform_skip_flag[ x0 ][ y0 ]equal to 1specifies that no transform is applied to the luma transform block,transform_skip_flag[ x0 ][ y0 ] equal to 0 specifies that the decisionwhether transform is applied to the luma transform block or not dependson other syntax elements. When transform_skip_flag[ x0 ][ y0 ] is notpresent, it is inferred as follows: - If BdcpmFlag[ x0 ][ x0 ] is equalto 1, transform_skip_flag[ x0 ][ y0 ] is inferred to be   equal to 1. -Otherwise (BdcpmFlag[ x0 ][ x0 ] is equal to 0), transform_skip_flag[ x0][ y0 ] is   inferred to be equal to 0. tu_mts_idx[ x0 ][ y0 ] specifieswhich transform kernels are applied to the residual samples along thehorizontal and vertical direction of the associated luma transformblock. The array indices x0, y0 specify the location ( x0, y0 ) of thetop-left luma sample of the considered transform block relative to thetop-left luma sample of the picture. When_tu_mts_idx[ x0 ][ y0 ] is notpresent, it is inferred to be equal to 0.

Table 11 shows part of syntax and semantics of a transform unitaccording to an example. tu_mts_idx[x0][y0] specifies an MTS indexapplied to a transform block, and trTypeHor and trTypeVer may bedetermined according to the MTS index as shown in Table 1.

According to another example, mts_idx may be signaled in a coding unitlevel rather than in a transform unit level.

TABLE 12 7.3.8.11 Residual coding syntax residual_coding( x0, y0,log2TbWidth, log2TbHeight, cIdx ) { Descriptor if( ( tu_mts_idx[ x0 ][y0 ] > 0 | |  ( cu_sbt_flag && log2TbWidth < 6 && log2TbHeight < 6 ) ) && cIdx = = 0 && log2TbWidth > 4 &&sps_mts_enabled_flag ) log2ZoTbWidth = 4 else  log2ZoTbWidth = Min( log2TbWidth, 5) MaxCcbs =2 * ( 1 << log2TbWidth ) * ( 1<< log2TbHeight) if( ( tu_mts idx[ x0 ][y0 ] > 0 | | ( cu_sbt_flag && log2TbWidth < 6   && log2TbHeight < 6 ) )   && cIdx = = 0 && log2TbHeight > 4   &&sps_mts_enabled_flag ) log2ZoTbHeight = 4 else  log2ZoTbHeight = Min( log2TbHeight, 5) if(log2TbWidth > 0)  last_sig_coeff_x_prefix ae(v) if( log2TbHeight > 0) last_sig_coeff_y_prefix ae(v) if( last_sig_coeff x_prefix > 3) last_sig_coeff_x_suffix ae(v) if( last_sig_coeff_y_prefix > 3) last_sig_coeff_y_suffix ae(v) log2TbWidth = log2ZoTbWidth log2TbHeight= log2ZoTbHeight 7.4.9.11 Residual coding semanticslast_sig_coeff_x_prefix specifies the prefix of the column position ofthe last significant coefficient in scanning order within a transformblock. The values of last_sig_coeff_x_prefix shall be in the range of 0to ( log2ZoTbWidth << 1) − 1, inclusive. When last_sig_coeff_x_prefix isnot present, it is inferred to be 0. last_sig_coeff_ y_prefix specifiesthe prefix of the row position of the last significant coefficient inscanning order within a transform block. The values oflast_sig_coeff_y_prefix shall be in the range of 0 to ( log2ZoTbHeight<< 1) − 1, inclusive. When last_sig_coeff_y_prefix is not present, it isinferred to be 0. last_sig_coeff_x_prefix specifies the prefix of thecolumn position of the last significant coefficient in scanning orderwithin a transform block. The values of last_sig_coeff_x_prefix shall bein the range of 0 to ( log2TbWidth << 1) − 1, inclusive. Whenlast_sig_coeff_x_prefix is not present, it is inferred to be 0.last_sig_coeff_y_prefix specifies the prefix of the row position of thelast significant coefficient in scanning order within a transform block.The values of last_sig_coeff_y_prefix shall be in the range of 0 to (log2TbHeight << 1) − 1, inclusive. When last_sig_coeff_y_prefix is notpresent, it is inferred to be 0.

Table 12 shows part of syntax and semantics of residual coding accordingto an example.

Syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix in Table 12 specify(x, y) position information on the last non-zero transform coefficientin a transform block. Specifically, last_sig_coeff_x_prefix specifies aprefix of a column position of the last significant coefficient in ascan order in the transform block, last_sig_coeff_y_prefix specifies aprefix of a row position of the last significant coefficient in the scanorder in the transform block, last_sig_coeff_x_suffix specifies a suffixof the column position of the last significant coefficient in the scanorder in the transform block, and last_sig_coeff_y_suffix specifies asuffix of the row position of the last significant coefficient in thescan order in the transform block. Here, the significant coefficient mayrefer to the non-zero coefficient. Further, the scan order may be aright upward diagonal scan order. Alternatively, the scan order may be ahorizontal scan order or a vertical scan order. The scan order may bedetermined based on whether inter/inter prediction is applied to atarget block (CB or CB including a TB) and/or a specific intra/interprediction mode.

A zero-out region may be configured in the residual coding of Table 12based on tu_mts_idx[x0][y0] of Table 11.

Further, when cu_sbt_flag is equal to 1, the height of the block towhich the transform is applied is 32 or less (log 2TbHeight<6), thewidth thereof is 32 (log 2TbWidth<6 && log 2TbWidth>4), andsps_mts_enabled_flag is equal to 1, the width of the top-left region inwhich the non-zero transform coefficient may exist is set to 16 (log2ZoTbWidth=4). Similarly, when cu_sbt_flag is equal to 1, the width ofthe block to which the transform is applied is 32 or less (log2TbWidth<6), the height thereof is 32 (log 2TbHeight<6 && log2TbHeight>4), and sps_mts_enabled_flag is equal to 1, the height of thetop-left region in which the non-zero transform coefficient may exist isset to 16 (log 2ZoTbHeight=4).

The block to which the transform is applied may be the originaltransform block or the partitioned subblock.

Here, log 2ZoTbWidth and log 2ZoTbHeight denote the maximum width andmaximum height of the top-left region in the transform block in whichthe non-zero coefficient may exist, and the top-left region may bereferred to as a “reduced transform block”. That is, log 2ZoTbWidth andlog 2ZoTbHeight may be defined as variables indicating the width andheight of the reduced transform block.

That is, according to an example, when the subblock transform is appliedto the coding unit, the MTS needs to be applicable in order to apply azero-out (RMTS) in which the width of the top-left block in which thenon-zero coefficient may exist is reduced to 16 and the remaining regionis 0.

When the MTS is not applied, even though it is identified that the SBTis applied to the coding unit (when cu_sbt_flag is 1), DCT-2 rather thanthe MTS needs to be applied to the subblock to which the transform isapplied. For example, when sps_mts_enabled_flag is equal to 0, eventhough the SBT is applied to the coding block, DCT-2 rather than DST-7or DCT-8 is applied.

In addition, when the SBT is applied to the coding block, DCT-2 isapplied only when the width or height of the subblock is 64 or greater,and DCT-2 is not applied in other cases.

That is, to ensure that DCT-2 is applied to the subblock and to preventthe RMTS that may cause data loss from being applied to the subblock towhich DCT-2 is applied, the encoding apparatus configures imageinformation for checking the value of sps_mts_enabled_flag, and thedecoding apparatus checks the value of sps_mts_enabled_flag in residualcoding according to the configured image information.

In summary, when it is identified only that cu_sbt_flag is 1 in an imagedecoding process, the value of sps_mts_enabled_flag signaled in thesequence parameter set may be checked when setting a transform blocksize according to the RMTS in order to prevent the RMTS from beingapplied to the subblock to which DCT-2 is applied. When cu_sbt_flag isequal to 1 and sps_mts_enabled_flag is equal to 1, the RMTS may beapplied, and thus the width and height of the top-left block in whichthe non-zero transform coefficient may exist may be set to 16, and whencu_sbt_flag is equal to 1 and sps_mts_enabled_flag is equal to 0, theMTS is not applied because DCT-2 is used for the transform, and thus azero-out according to the RMTS is also not applied. In this case, thewidth and height of the top-left block in which the non-zero transformcoefficient may exist may be set to 32 or less.

For example, in a case of a 32×32 transform block to which the subblocktransform is applied, when sps_mts_enabled_flag is equal to 0, DCT-2 isused as a transform kernel, and thus the width or height having a lengthof 32 is not reduced to 16.

As described above, when the MTS is disabled, it is possible to preventan RMTS of zeroing-out to a length of 16 by checkingsps_mts_enabled_flag.

In other cases, when cu_sbt_flag is not 1, the height of the transformblock is greater than 32, the width of the transform block is not 32, orthe MTS is not applied, the width of the transform block may be set to asmaller value of the width of the transform block and 32. That is, themaximum width of the transform block may be limited to 32 by thehigh-frequency zero-out. Further, when cu_sbt_flag is not 1, the widthof the transform block is greater than 32, the height of the transformblock is not 32, or the MTS is not applied, the height of the transformblock may be set to a smaller value of the height of the transform blockand 32. That is, the maximum height of the transform block may belimited to 32 by the zero-out.

When the SBT is applied, if the length of at least one side of thepartitioned block is 64 or greater, DCT-2 may be applied in both thehorizontal direction and the vertical direction. Otherwise, DST-7 orDCT-8 may be applied as shown in Table 10. Accordingly, when the SBT isapplied, a zero-out may be performed by applying RMTS32 only when all oftwo sides of the partitioned block to which the transform is appliedhave a length of 32 or less. That is, when the length of the block ineach direction is 32, DST-7 or DCT-8 with a length of 32 may be applied,thereby leaving only 16 transform coefficients.

As shown in Table 12, when RMTS32 is applied, coding may be performedconsidering the width and height of the remaining region which is notzeroed-out (low-frequency transform coefficient region) as the width andheight of the actual transform block rather than using the width andheight of the original transform block for the coding (log 2ZoTbWidth=4or log 2ZoTbHeight=4).

For example, in a case where the width×height of the original transformblock is 32×16, when RMTS32 is applied, non-zero coefficients exist onlyin a top-left 16×16 region due to a zero-out. Accordingly, the width andheight of the top-left region in which the non-zero transformcoefficients may exist are set to 16 and 16, respectively, and thencoding of syntax elements (eg, last_sig_coeff_x_prefix andlast_sig_coeff_y_prefix) may be performed.

In summary, according to the residual coding in Table 12, log 2ZoTbWidthand log 2ZoTbHeight indicating the maximum width and the maximum heightin which non-zero coefficients may exist are set before codinglast_sig_coeff_x_prefix, the position of the last non-zero coefficientis coded by applying log 2ZoTbWidth and log 2ZoTbHeight, and then thewidth and height of the actual transform block are changed to log2ZoTbWidth and log 2ZoTbHeight, respectively (log 2TbWidth=log2ZoTbWidth and log 2TbHeight=log 2ZoTbHeight). Subsequently, the syntaxelements may be coded according to the changed values. Consequently, theremaining top-left region excluding the zero-out region in the residualcoding may be configured as a new transform block, and then residualsamples may be derived.

When the size of the transform block is reduced to a low-frequencytransform coefficient region by the zero-out of the high-frequencytransform coefficients, the values of last_sig_coeff_x_prefix andlast_sig_coeff_y_prefix may be limited to a range from 0 to a valuebetween (log 2ZoTbWidth<<1)−1 and (log 2ZoTbHeight<<1)−1 as shown in thesemantics of Table 12.

TABLE 13 8 Decoding process ...... 8.7 Scaling, transformation and arrayconstruction process ...... 8.7.4 Transformation process for scaledtransform coefficients 8.7.4.1 General Inputs to this process are: - aluma location ( xTbY, yTbY ) specifying the top-left sample of thecurrent luma  transform block relative to the top-left luma sample ofthe current picture, - a variable nTbW specifying the width of thecurrent transform block, - a variable nTbH specifying the height of thecurrent transform block, - a variable cIdx specifying the colourcomponent of the current block, - an (nTbW)x(nTbH) array d[ x ][ y ] ofscaled transform coefficients with x =  0..nTbW − 1, y = 0..nTbH − 1.Output of this process is the (nTbW)x(nTbH) array r[ x ][ y ] ofresidual samples with x = 0..nTbW − 1, y = 0..nTbH − 1. When lfnst_idx[xTbY ][ yTbY ] is not equal to 0 and both nTbW and nTbH are greater thanor equal to 4, the following applies: - The variables predModeIntra,nLfnstOutSize, log2LfnstSize, nLfnstSize, and  nonZeroSize are derivedas follows:   predModeIntra = ( cIdx = = 0) ? IntraPredModeY[ xTbY ][yTbY ] :   IntraPredModeC[ xTbY ][ yTbY ]   (8-965)   nLfnstOutSize =(nTbW >= 8 && nTbH >= 8) ? 48 : 16    (8-966)   log2LfnstSize = (nTbW >= 8 && nTbH >= 8) ? 3 : 2    (8-967)   nLfnstSize = 1 <<log2LfnstSize      (8-968)   nonZeroSize = ( ( nTbW = = 4 && nTbH = = 4) | | ( nTbW = = 8 &&   nTbH = = 8 ) ) ? 8 : 16(8-969)

- When intra_mip_flag[ xTbComp ][ yTbComp ] is equal to 1 and cIdx isequal to 0, predModeIntra is setequal to INTRA_PLANAR. - WhenpredModeIntra is equal to either INTRA_LT_CCLM, INTRA_L_CCLM, orINTRA_T_CCLM, predModeIntra is set equal to IntraPredModeY[ xTbY + nTbW/ 2 ][ yTbY + nTbH / 2 ]. - The wide angle intra prediction mode mappingprocess as specified in clause 8.4.5.2.6 is invoked with predModeIntra,nTbW, nTbH and cIdx as inputs, and the modified predModeIntra asoutput. - The values of the list u[ x ] with x = 0..nonZeroSize − 1 arederived as follows:  xC = DiagScanOrder[ 2 ][ 2 ][ x ][ 0 ]         (8-970)  yC = DiagScanOrder[ 2 ][ 2 ][ x ][ 1 ]         (8-971)  u[ x ] = d[ xC ][ yC ]     (8-972) - Theone-dimensional low frequency non-separable transformation process asspecified in clause 8.7.4.2 is invoked with the input length of thescaled transform coefficients nonZeroSize, the transform output lengthnTrS set equal to nLfnstOutSize, the list of scaled non-zero transformcoefficients u[ x ] with x = 0..nonZeroSize − 1, the intra predictionmode for LFNST set selection predModeIntra, and the LFNST index fortransform selection in the selected LFNST set lfnst_idx[ xTbY ][ yTbY ]as inputs, and the list v[ x ] with x = 0..nLfnstOutSize − 1 asoutput. - The array d[ x ][ y ] with x = 0..nLfnstSize − 1, y =0..nLfnstSize − 1 is derived as follows: - If predModeIntra is less thanor equal to 34, the following applies:  d[ x ][ y ] = ( y < 4 ) ? v[ x +( y << log2LfnstSize ) ] :   (8-973)   ( ( x < 4 ) ? v[ 32 + x + ( ( y −4 ) << 2 ) ] : d[ x ][ y ] ) - Otherwise, the following applies:  d[ x][ y ] = ( x < 4) ? v[ y + ( x << log2LfnstSize ) ] :   (8-974)    ( ( y< 4 ) ? v[ 32 + y + ( ( x − 4 ) << 2 ) ] : d[ x ][ y ] )

The variable implicitMtsEnabled is derived as follows: - Ifsps_mts_enabled flag is equal to 1 and one of the following conditionsis true, implicitMtsEnabled is set equal to 1: -IntraSubPartitionsSplitType is not equal to ISP_NO_SPLIT - cu_sbt_flagis equal to 1 and Max( nTbW, nTbH ) is less than or equal to 32 -sps_explicit_mts_intra_enabled_flag is equal to 0 and CuPredModel[ 0 ][xTbY ][ yTbY ] is equal to MODE_INTRA and lfnst_idx[ x0 ][ y0 ] is equalto 0 and intra_mip_flag[ x0 ][ y0 ] is equal to 0 - Otherwise,implicitMtsEnabled is set equal to 0.  The variable trTypeHor specifyingthe horizontal transform kernel and the  variable trTypeVer specifyingthe vertical transform kernel are derived as  follows: - If cIdx isgreater than 0, trTypeHor and trTypeVer are set equal to 0. - Otherwise,if implicitMtsEnabled is equal to 1, the following applies: - IfIntraSubPartitionsSplitType is not equal ot ISP_NO_SPLITorsps_explicit_mts_intra_enabled_flag is equal to 0 and CuPredMode[ 0 ][xTbY ][ yTbY ] is equal to MODE_INTRA, trTypeHor and trTypeVer arederived as follows: trTypeHor = ( nTbW >= 4 && nTbW <= 16) ? 1: 0      (8-975) trTypeVer = ( nTbH >= 4 && nTbH <= 16) ? 1: 0       (8-976) - Otherwise (cu_sbt_flag is equal to 1), trTypeHor andtrTypeVer are specified in Table 8-15 depending oncu_sbt_horizontal_flag and cu_sbt_pos_flag. - Otherwise, trTypeHor andtrTypeVer are specified in Table 8-14 depending on tu_mts_idx[ xTbY ][yTbY ].

The variables nonZeroW and nonZeroH are derived as follows: - Iflfnst_idx[ xTbY ][ yTbY ] is not equal to 0 and nTbW is greater than orequal to 4 and nTbH is greater than or equal to 4, the followingapplies:  nonZeroW = ( nTbW = = 4 | | nTbH = = 4) ? 4 :8          (8-977)  nonZeroH = ( nTbW = = 4 | | nTbH = = 4) ? 4 : 8          (8-978) - Otherwise, the following applies:  nonZeroW = Min(nTbW, ( trTypeHor > 0) ? 16 : 32)         (8-979)  nonZeroH = Min( nTbH,( trTypeVer > 0) ? 16 : 32)          (8-980) The (nTbW)x(nTbH) array rof residual samples is derived as follows: 1. When nTbH is greater than1, each (vertical) column of scaled transform coefficients d[ x ][ y ]with x = 0..nonZeroW − 1, y = 0..nonZeroH − 1 is transformed to e[ x ][y ] with x = 0..nonZeroW − 1, y = 0..nTbH − 1 by invoking theone-dimensional transformation process as specified in clause 8.7.4.4for each column x = 0..nonZeroW − 1 with the height of the transformblock nTbH, the non-zero height of the scaled transform coefficientsnonZeroH, the list d[ x ][ y ] with y = 0..nonZeroH − 1 and thetransform type variable trType set equal to trTypeVer as inputs, and theoutput is the list e[ x ][ y ] with y = 0..nTbH − 1. 2. When nTbH andnTbW are both greater than 1, the intermediate sample values g[ x ][ y ]with x = 0..nonZeroW − 1, y = 0..nTbH − 1 are derived as follows:  g[ x][ y ] = Clip3( CoeffMin, CoeffMax, ( e[ x ][ y ] + 64) >> 7)    (8-981) 3. When nTbW is greater than 1, each (horizontal) row of theresulting array g[ x ][ y ] with x = 0..nonZeroW − 1, y = 0..nTbH − 1 istransformed to r[ x ][ y ] with x = 0..nTbW − 1, y = 0..nTbH − 1 byinvoking the one-dimensional transformation process as specified inclause 8.7.4.4 for each row y = 0..nTbH − 1 with the width of thetransform block nTbW, the non-zero width of the resulting array g[ x ][y ] nonZeroW, the list g[ x ][ y ] with x = 0..nonZeroW − 1 and thetransform type variable trType set equal to trTypeHor as inputs, and theoutput is the list r[ x ][ y ] with x = 0..nTbW − 1. 4. When nTbW isequal to 1, r[ x ][ y ] is set equal to e[ x ][ y ] for x = 0..nTbW − 1,y = 0..nTbH − 1.

Table 13 illustrates a transform process, which shows that the MTS isimplicitly applied when the SBT is applied to the coding unit(cu_sbt_flag is equal to 1 and Max(nTbW, nTbH) is less than or equal to32, implicitMtsEnabled is set equal to 1).

The variable trTypeHor denoting the horizontal transform kernel and thevariable trTypeVer denoting the vertical transform kernel may be derivedbased on Table 8-14, and Table 8-14 of Table 13 may correspond to Table1 of this document.

In addition, when the SBT is applied to the coding unit, the variablestrTypeHor and trTypeVer may be derived based on Table 8-15, and Table8-15 of Table 13 may correspond to Table 10 of this document.

The size of the block to which the zero-out is applied, that is, thezero-out block, illustrated in Table 12 is expressed as nonZeroW andnonZeroH in Table 13. nonZeroW and nonZeroH may be defined as variablesdenoting the width and height of the top-left block in which a non-zerotransform coefficient may exist.

When no LFNST is applied, nonZeroW may be set to a smaller value of avalue based on whether trTypeHor is greater than 0 ((trTypeHor>0)? 16:32) and the width (nTbW) of the transform block (nonZeroW=Min (nTbW,(trTypeHor>0)? 16:32)). When trTypeHor is greater than 0, since the MTSis applied, “(trTypeHor>0)? 16:32” is set to 16, and thus nonZeroW isset to a smaller value of the width (nTbW) of the transform block and16. However, when trTypeHor is not greater than 0, since the MTS is notapplied, “(trTypeHor>0)? 16:32” is set to 32, and thus nonZeroW is setto a smaller value of the width (nTbW) of the transform block and 32.

Similarly, when no LFNST is applied, nonZeroH may be set to a smallervalue of a value based on whether trTypeVer is greater than 0((trTypeVer>0)? 16: 32) and the width (nTbH) of the transform block(nonZeroH=Min(nTbH, (trTypeVer>0)? 16: 32)). When trTypeVer is greaterthan 0, since the MTS is applied, “(trTypeVer>0)? 16:32” is set to 16,and accordingly nonZeroH is set to a smaller value of the height (nTbH)of the transform block and 16. However, when trTypeVer is not greaterthan 0, since the MTS is not applied, “(trTypeVer>0)? 16: 32” is set to32, and thus nonZeroH is set to a smaller value of the height (nTbH) ofthe transform block and 32.

That is, the size of the zero-out block is set to 16 or 32 depending onwhether the MTS is applied, that is, whether trTypeHor and trTypeVer canhave a value of 0 or greater.

Residual sample values may be derived based on nonZeroW and nonZeroH setconsidering the zero out (When nTbH is greater than 1, each (vertical)column of scaled transform coefficients d[x][y] with x=0 . . .nonZeroW−1, y=0 . . . nonZeroH−1 is transformed to e[x][y] with x=0 . .. nonZeroW−1, y=0 . . . nTbH−1 by invoking the one-dimensionaltransformation process as specified in clause 8.7.4.4 for each columnx=0 . . . nonZeroW−1 with the height of the transform block nTbH, thenon-zero height of the scaled transform coefficients nonZeroH, the listd[x][y] with y=0 . . . nonZeroH−1 and the transform type variable trTypeset equal to trTypeVer as inputs, and the output is the list e[x][y]with y=0 . . . nTbH−1).

When the size of the transform block is changed by applying thezero-out, the size of a transform block used for context selection oflast_sig_coeff_x_prefix and last sig_coeff_y_prefix may also be changed.Table 14 shows binarization of last_sig_coeff_x_prefix and lastsig_coeff_y_prefix considering the reduced transform block, and Table 15shows a process of deriving ctxInc (context increment) for derivinglast_sig_coeff_x_prefix and last sig_coeff_y_prefix. Since context maybe selected and distinguished by the context increment, a context modelmay be derived based on the context increment.

TABLE 14 9 Parsing process ...... 9.3 CABAC parsing process for slicedata ...... 9.3.3 Binarization process 9.3.3.1 General Input to thisprocess is a request for a syntax element. Output of this process is thebinarization of the syntax element. Table 9-77 specifies the type ofbinarization process associated with each syntax element andcorresponding inputs. The specification of the truncated Rice (TR)binarization process, the truncated binary (TB) binarization process,the k-th order Exp-Golomb (EGk) binarization process and the fixed-length (FL) binarization process are given in clauses 9.3.3.3 through9.3.3.7, respectively. Table 9-77 - Syntax elements and associatedbinarizations Syntax Binarization structure Syntax element Process Inputparameters ...... ...... ...... ...... residual_codin last_sig_coeff_x_pTR cMax = ( log2ZoTbWidth << 1 ) − 1, g( ) refix cRiceParam = 0 lastsig_coeff_y_p TR cMax = ( log2ZoTbHeight << 1 ) − refix 1, cRiceParam =0 last sig_coeff_x_s FL cMax = ( 1 << uffix ( (last_sig_coeff_x_prefix >> 1 ) − 1 ) − 1 ) last_sig_coeff_y_s FL cMax =( 1 << uffix ( ( last_sig_coeff_y_prefix >> 1 ) − 1 ) − 1 ) ..... .......... .....

TABLE 15 9.3.4 Decoding process flow ...... 9.3.4.2 Derivation processfor ctxTable, ctxIdx and bypassFlag 9.3.4.2.1 General ...... 9.3.4.2.4Derivation process of ctxInc for the syntax elementslast_sig_coeff_x_prefix and last_sig_coeff_y_prefix Inputs to thisprocess are the variable binIdx, the colour component index cIdx, thebinary logarithm of the transform block width log2TbWidth and thetransform block height log2TbHeight. Output of this process is thevariable ctxInc. The variable log2TbSize is derived as follows: - If thesyntax element to be parsed is last_sig_coeff_x_prefix, log2TbSize isset equal to log2TbWidth. - Otherwise (the syntax element to be parsedis last_sig_coeff y_prefix), log2TbSize is set equal to log2TbHeight. The variables ctxOffset and ctxShift are derived as follows: - If cIdxis equal to 0, ctxOffset is set equal to offsetY[ log2TbSize − 2 ] andctxShift is set equal to ( log2TbSize + 1 ) >> 2 with the list offsetYspecified as follows:  offsetY[ ] = {0, 3, 6, 10, 15}    (9-34) -Otherwise (cIdx is greater than 0), ctxOffset is set equal to 20 andctxShift is set equal to Clip3( 0, 2, 2^(log2TbSize) >> 3 ).  Thevariable ctxInc is derived as follows:   ctxInc = ( binIdx >>ctxShift) + ctxOffset (9-35)

As illustrated in Table 14, the maximum values (cMax) oflast_sig_coeff_x_prefix and last_sig_coeff_y_prefix are set based on log2ZoTbWidth and log 2ZoTbHeight corresponding to the width and height ofthe reduced transform block as the low-frequency transform coefficientregion (cMax=(log 2ZoTbWidth<<1)−1, cMax=(log 2ZoTbHeight<<1)−1). When atruncated unary is used for the binarization of last_sig_coeff_x_prefixand last_sig_coeff_y_prefix, the maximum values (cMax) oflast_sig_coeff_x_prefix and last_sig_coeff_y_prefix may be set to beequal to the maximum values of codewords used for the binarization oflast_sig_coeff_x_prefix and last_sig_coeff_y_prefix. Therefore, themaximum length of a prefix codeword denoting last significantcoefficient prefix information may be derived based on the size of thezero-out block.

As illustrated in Table 15, for CABAC context for the two syntaxelements, that is, last_sig_coeff_x_prefix and last_sig_coeff_y_prefix,the size of the original transform block (TU) rather than the reducedtransform block in the low-frequency transform coefficient region isapplied (log 2TbSize is set equal to log 2TbWidth, log 2TbSize is setequal to log 2TbHeight).

In summary, according to an example, residual samples may be derivedbased on the last significant coefficient position information, in whichthe context model may be derived based on the size of the originaltransform block of which the size is not changed, and the lastsignificant coefficient position may be derived based on the size of thetransform block to which the zero-out has been applied. Here, the size,specifically, the width or height, of the transform block to which thezero-out has been applied, that is, the zero-out block, is smaller thanthe size, width, or height of the original transform block.

The following drawings are provided to describe specific examples of thepresent disclosure. Since the specific designations of devices or thedesignations of specific signals/messages/fields illustrated in thedrawings are provided for illustration, technical features of thepresent disclosure are not limited to specific designations used in thefollowing drawings.

FIG. 7 is a flowchart illustrating the operation of a video decodingapparatus according to an embodiment of the present disclosure.

Each operation illustrated in FIG. 7 may be performed by the decodingapparatus 300 illustrated in FIG. 3. Specifically, S700 and S710 may beperformed by the entropy decoder 310 illustrated in FIG. 3, S720 may beperformed by the dequantizer 321 illustrated in FIG. 3, S730 may beperformed by the inverse transformer 322 illustrated in FIG. 3, and S740may be performed by the adder 340 illustrated in FIG. 3. Operationsaccording to S700 to S740 are based on some of the foregoing detailsexplained with reference to FIG. 4 to FIG. 6. Therefore, a descriptionof specific details overlapping with those explained above withreference to FIG. 3 to FIG. 6 will be omitted or will be made briefly.

The decoding apparatus according to an embodiment may receive abitstream including residual information (S700). Specifically, theentropy decoder 310 of the decoding apparatus may receive the bitstreamincluding the residual information.

The decoding apparatus according to an embodiment may derive quantizedtransform coefficients for a current block based on the residualinformation included in the bitstream (S710). Specifically, the entropydecoder 310 of the decoding apparatus may the quantized transformcoefficients for the current block based on the residual informationincluded in the bitstream.

The decoding apparatus according to an embodiment may derive transformcoefficients from the quantized transform coefficients based on adequantization process (S720). Specifically, the dequantizer 321 of thedecoding apparatus may derive the transform coefficients from thequantized transform coefficients based on the dequantization process.

The decoding apparatus according to an embodiment may derive residualsamples for the current block by applying inverse transform to thederived transform coefficients (S730). Specifically, the inversetransform 322 of the decoding apparatus may derive the residual samplesfor the current block by applying the inverse transform to the derivedtransform coefficients.

The decoding apparatus according to an embodiment may generate areconstructed picture based on the residual samples for the currentblock (S740). Specifically, the adder 340 of the decoding apparatus maygenerate the reconstructed picture based on the residual samples for thecurrent block.

In an embodiment, the unit of the current block may be a transform block(TB).

In an embodiment, each of the transform coefficients for the currentblock may be related to a high-frequency transform coefficient regionincluding a transform coefficient of 0 or a low-frequency transformcoefficient region including at least one significant transformcoefficient.

In an embodiment, the residual information may include last significantcoefficient prefix information and last significant coefficient suffixinformation on the position of a last significant transform coefficientamong the transform coefficients for the current block.

In one example, the last significant coefficient prefix information mayhave a maximum value determined based on the size of a zero-out block.

In an embodiment, the position of the last significant transformcoefficient may be determined based on a prefix codeword indicating thelast significant coefficient prefix information and the last significantcoefficient suffix information.

In an embodiment, the maximum length of the prefix codeword may bedetermined based on the low-frequency transform coefficient region, thatis, the size of the zero-out block.

In an embodiment, the size of the zero-out block may be determined basedon the width and height of the current block.

In an embodiment, the last significant coefficient prefix informationmay include x-axis prefix information and y-axis prefix information, andthe prefix codeword may be a codeword on the x-axis prefix informationand a codeword for the y-axis prefix information.

In one example, the x-axis prefix information may be expressed aslast_sig_coeff_x_prefix, the y-axis prefix information may be expressedas last_sig_coeff_y_prefix, and the position of the last significanttransform coefficient may be expressed as (LastSignificantCoeffX,LastSignificantCoeffY).

In an embodiment, the residual information may include information onthe size of the zero-out block.

FIG. 8 is a flowchart illustrating a process for deriving a transformcoefficient by a video decoding apparatus according to an embodiment ofthe present disclosure.

Each operation illustrated in FIG. 8 may be performed by the decodingapparatus 300 illustrated in FIG. 3. Specifically, S800 to S840 may beperformed by the entropy decoder 310 illustrated in FIG. 3.

First, as illustrated, a zero-out block for a current block may bederived (S800). As described above, the zero-out block refers to alow-frequency transform coefficient region including a non-zerosignificant transform coefficient, and the width or height of thezero-out block may be derived based on whether an MTS using a pluralityof transform kernel is applicable to the current block, whether asubblock transform is applied, and the width or height of the currentblock.

According to an example, the decoding apparatus may set the width orheight of the zero-out block to 16 when the MTS is applied, and may setthe width or height of the zero-out block to 32 or less when the MTS isnot applied. In this case, whether the MTS is applicable may bedetermined based on sps_mts_enabled_flag indicating whether the MTS isapplicable.

Specifically, when DST-7 or DCT-8 is applied rather than DCT-2 as atransform kernel used for an inverse primary transform, the width of thecurrent block is 32, and the height of the current block is 32 or less,the width of the zero-out block may be set to 16. When the aboveconditions are not satisfied, that is, when the transform kernel isDCT-2, the width of the current block is not 32, or the height of thecurrent block is 64 or greater, the width of the zero-out block may beset to a smaller value of the width of the current block and 32.

Similarly, when DST-7 or DCT-8 is applied rather than DCT-2 as thetransform kernel used for the inverse primary transform, the height ofthe current block is 32, and the width of the current block is 32 orless, the height of the zero-out block may be set to 16. When the aboveconditions are not satisfied, that is, when the transform kernel isDCT-2, the height of the current block is not 32, or the width of thecurrent block is 64 or greater, the height of the zero-out block may beset to a smaller value of the height of the current block and 32.

Further, according to an example, the width or height of the zero-outblock may be derived based on flag information (cu_sbt_flag) indicatingwhether the current block is partitioned into subblocks and transformed.For example, when the value of a flag indicating whether the currentblock is partitioned into subblocks and transformed is 1, the width of apartitioned subblock is 32, and the height of the subblock is less than64, the width of a top-left region in which a non-zero transformcoefficient may exist in the subblock may be set to 16. Alternatively,when the value of the flag indicating whether the current block ispartitioned into subblocks and transformed is 1, the height of thepartitioned subblock is 32, and the width of the subblock is less than64, the height of the top-left region in which the non-zero transformcoefficient may exist in the subblock may be set to 16.

The transform kernel may be derived based on the partition direction ofthe current block and the position of a subblock to which the transformis applied as shown in Table 10.

The width or height of the zero-out block may be derived based on an MTSindex for the current block or flag information indicating whether theMTS is applied to transformation of the current block.

The size of the zero-out block may be smaller than the size of thecurrent block. Specifically, the width of the zero-out block may besmaller than the width of the current block, and the height of thezero-out block may be smaller than the height of the current block.

In an embodiment, the size of the zero-out block may be one of 32×16,16×32, 16×16, or 32×32.

In an embodiment, the size of the current block may be 64×64, and thesize of the zero-out block may be 32×32.

The decoding apparatus may derive a context model for last significantcoefficient position information based on the width or height of thecurrent block (S810).

According to an example, the context model may be derived based on thesize of an original transform block rather than the size of the zero-outblock. Specifically, a context increment for x-axis prefix informationand y-axis prefix information corresponding to last significantcoefficient prefix information may be derived based on the size of theoriginal transform block.

The decoding apparatus may derive a value of the last significantcoefficient position information based on the derived context model(S820).

As described above, the last significant coefficient positioninformation may include last significant coefficient prefix informationand last significant coefficient suffix information, and the value ofthe last significant coefficient position may be derived based on thecontext model.

The decoding apparatus may derive the last significant coefficientposition based on the derived value of the last significant coefficientposition information and the width or the height of the zero-out block(S830).

In one example, the decoding apparatus may derive the last significantcoefficient position within the range of the size of the zero-out blocksmaller than that of the current block rather than the original currentblock. That is, a transform coefficient to which transform is appliedmay be derived within the range of the size of the zero-out block ratherthan the current block.

In one example, the last significant coefficient prefix information mayhave a maximum value determined based on the size of the zero-out block.

In one example, the last significant coefficient position may be derivedbased on a prefix codeword indicating the last significant coefficientprefix information and the last significant coefficient suffixinformation, and the maximum length of the prefix codeword may bedetermined based on the size of the zero-out block.

The decoding apparatus may derive transform coefficients based on thelast significant coefficient position derived based on the width or theheight of the zero-out block (S840).

The transform coefficients may be derived through the residual codingprocess of Table 13.

Subsequently, the decoding apparatus may derive residual samples byperforming at least one of the foregoing non-separable inverse secondarytransform and the inverse primary transform based on Table 1 and Table10.

The following drawings are provided to describe specific examples of thepresent disclosure. Since the specific designations of devices or thedesignations of specific signals/messages/fields illustrated in thedrawings are provided for illustration, technical features of thepresent disclosure are not limited to specific designations used in thefollowing drawings.

FIG. 9 is a flowchart illustrating the operation of a video encodingapparatus according to an embodiment of the present disclosure.

Each operation illustrated in FIG. 9 may be performed by the encodingapparatus 200 illustrated in FIG. 2. Specifically, S900 may be performedby the subtractor 231 illustrated in FIG. 2, S910 may be performed bythe transformer 232 illustrated in FIG. 2, S920 may be performed by thequantizer 233 illustrated in FIG. 2, and FIG. 930 may be performed bythe entropy encoder 240 illustrated in FIG. 2. Operations according toS900 to S930 are based on some of the foregoing details explained withreference to FIG. 4 to FIG. 6. Therefore, a description of specificdetails overlapping with those explained above with reference to FIG. 2and FIG. 4 to FIG. 6 will be omitted or will be made briefly.

The encoding apparatus according to an embodiment may derive residualsamples for a current block (S900). Specifically, the subtractor 231 ofthe encoding apparatus may derive the residual samples for the currentblock.

The encoding apparatus according to an embodiment may transform theresidual samples for the current block, thereby deriving transformcoefficients for the current block (S910). Specifically, the transformer232 of the encoding apparatus may transform the residual samples for thecurrent block, thereby deriving transform coefficients for the currentblock.

The encoding apparatus according to an embodiment may derive quantizedtransform coefficients from the transform coefficients based onquantization (S920). Specifically, the quantizer 233 of the encodingapparatus may derive the quantized transform coefficients from thetransform coefficients based on the quantization.

The encoding apparatus according to an embodiment may encode residualinformation including information on the quantized transformcoefficients (S930). Specifically, the entropy encoder 240 of theencoding apparatus may encode the residual information including theinformation on the quantized transform coefficients.

In an embodiment, each of the transform coefficients for the currentblock may be related to a high-frequency transform coefficient regionincluding a transform coefficient of 0 or a low-frequency transformcoefficient region including at least one significant transformcoefficient, that is, a zero-out block.

In an embodiment, the residual information may include last significantcoefficient prefix information and last significant coefficient suffixinformation on the position of a last significant transform coefficientamong the transform coefficients for the current block.

In an embodiment, the position of the last significant transformcoefficient may be determined based on a prefix codeword indicating thelast significant coefficient prefix information and the last significantcoefficient suffix information.

In one example, the last significant coefficient prefix information mayhave a maximum value determined based on the size of the zero-out block.

In an embodiment, the maximum length of the prefix codeword may bedetermined based on the size of the zero-out block.

In an embodiment, the size of the zero-out block may be determined basedon the width and height of the current block.

In an embodiment, the last significant coefficient prefix informationmay include x-axis prefix information and y-axis prefix information, andthe prefix codeword may be a codeword on the x-axis prefix informationand a codeword for the y-axis prefix information.

In one example, the x-axis prefix information may be expressed aslast_sig_coeff_x_prefix, the y-axis prefix information may be expressedas last_sig_coeff_y_prefix, and the position of the last significanttransform coefficient may be expressed as (LastSignificantCoeffX,LastSignificantCoeffY)

In an embodiment, the residual information may include information onthe size of the zero-out block.

FIG. 10 is a flowchart illustrating a process for encoding a transformcoefficient and information according to an embodiment of the presentdisclosure.

Each operation disclosed in FIG. 10 may be performed by the encodingapparatus 200 disclosed in FIG. 2. Specifically, S1000 and S1010 may beperformed by the transformer 232, and S1020 to S1040 may be performed bythe entropy encoder 240 disclosed in FIG. 2.

First, as illustrated, a zero-out block for a current block may bederived (S1000). As described above, the zero-out block refers to alow-frequency transform coefficient region including a non-zerosignificant transform coefficient, and the width or height of thezero-out block may be derived based on whether an MTS using a pluralityof transform kernel is applicable to the current block, whether asubblock transform is applied, and the width or height of the currentblock.

According to an example, the encoding apparatus may set the width orheight of the zero-out block to 16 when the MTS is applied (whenDST-7/DCT-8 is applicable), and may set the width or height of thezero-out block to 32 or less when the MTS is not applied.

Specifically, when DST-7 or DCT-8 is applied rather than DCT-2 as atransform kernel used for a primary transform, the width of the currentblock is 32, and the height of the current block is 32 or less, thewidth of the zero-out block may be set to 16. When the above conditionsare not satisfied, that is, when the transform kernel is DCT-2, thewidth of the current block is not 32, or the height of the current blockis 64 or greater, the width of the zero-out block may be set to asmaller value of the width of the current block and 32.

Similarly, when DST-7 or DCT-8 is applied rather than DCT-2 as thetransform kernel used for the primary transform, the height of thecurrent block is 32, and the width of the current block is 32 or less,the height of the zero-out block may be set to 16. When the aboveconditions are not satisfied, that is, when the transform kernel isDCT-2, the height of the current block is not 32, or the width of thecurrent block is 64 or greater, the height of the zero-out block may beset to a smaller value of the height of the current block and 32.

Further, according to an example, the width or height of the zero-outblock may be derived based on whether the current block is partitionedinto subblocks and transformed. For example, when the current block ispartitioned into subblocks and transformed, the width of a partitionedsubblock is 32, and the height of the subblock is less than 64, thewidth of the subblock may be set to 16. Alternatively, when the currentblock is partitioned into subblocks and transformed, the height of thepartitioned subblock is 32, and the width of the subblock is less than64, the height of the subblock may be set to 16.

The transform kernel may be derived based on the partition direction ofthe current block and the position of a subblock to which the transformis applied as shown in Table 10.

In an embodiment, the size of the zero-out block may be one of 32×16,16×32, 16×16, or 32×32.

In an embodiment, the size of the current block may be 64×64, and thesize of the zero-out block may be 32×32.

The encoding apparatus may drive a transform coefficient based on thezero-out block (S1010).

The encoding apparatus may derive the transform coefficient fromresidual samples by performing the foregoing transformation process,that, is at least one of the primary transform and the non-separableinverse secondary transform based on Table 1 and Table 10.

The encoding apparatus may derive a last significant coefficientposition based on the derived width or height of the zero-out block(S1020).

In one example, the encoding apparatus may derive the last significantcoefficient position within the range of the size of the zero-out blocksmaller than or equal to that of the current block rather than theoriginal current block. That is, a transform coefficient to whichtransform is applied may be derived within the range of the size of thezero-out block rather than the current block.

In one example, the last significant coefficient position may be derivedbased on a prefix codeword indicating the last significant coefficientprefix information and the last significant coefficient suffixinformation, and the maximum length of the prefix codeword may bedetermined based on the size of the zero-out block.

The encoding apparatus may derive a context model for last significantcoefficient position information based on the width or the height of thecurrent block (S1030).

According to an embodiment, the context model may be derived based onthe size of an original transform block rather than the size of thezero-out block. Specifically, a context increment for x-axis prefixinformation and y-axis prefix information corresponding to lastsignificant coefficient prefix information may be derived based on thesize of the original transform block.

The encoding apparatus may encode position information on the value ofthe last significant coefficient position based on the derived contextmodel (S1040).

As described above, the last significant coefficient positioninformation may include last significant coefficient prefix informationand last significant coefficient suffix information, and the value ofthe last significant coefficient position may be encoded based on thecontext model.

In the present disclosure, at least one of quantization/dequantizationand/or transform/inverse transform may be omitted. Whenquantization/dequantization is omitted, a quantized transformcoefficient may be referred to as a transform coefficient. Whentransform/inverse transform is omitted, the transform coefficient may bereferred to as a coefficient or a residual coefficient, or may still bereferred to as a transform coefficient for consistency of expression.

Further, in the present disclosure, a quantized transform coefficientand a transform coefficient may be referred to as a transformcoefficient and a scaled transform coefficient, respectively. In thiscase, residual information may include information on a transformcoefficient(s), and the information on the transform coefficient(s) maybe signaled through a residual coding syntax. Transform coefficients maybe derived based on the residual information (or information on thetransform coefficient(s)), and scaled transform coefficients may bederived through inverse transform (scaling) of the transformcoefficients. Residual samples may be derived based on the inversetransform (transform) of the scaled transform coefficients. Thesedetails may also be applied/expressed in other parts of the presentdisclosure.

In the above-described embodiments, the methods are explained on thebasis of flowcharts by means of a series of steps or blocks, but thepresent disclosure is not limited to the order of steps, and a certainstep may be performed in order or step different from that describedabove, or concurrently with another step. Further, it may be understoodby a person having ordinary skill in the art that the steps shown in aflowchart are not exclusive, and that another step may be incorporatedor one or more steps of the flowchart may be removed without affectingthe scope of the present disclosure.

The above-described methods according to the present disclosure may beimplemented as a software form, and an encoding apparatus and/ordecoding apparatus according to the disclosure may be included in adevice for image processing, such as, a TV, a computer, a smartphone, aset-top box, a display device or the like.

When embodiments in the present disclosure are embodied by software, theabove-described methods may be embodied as modules (processes, functionsor the like) to perform the above-described functions. The modules maybe stored in a memory and may be executed by a processor. The memory maybe inside or outside the processor and may be connected to the processorin various well-known manners. The processor may include anapplication-specific integrated circuit (ASIC), other chipset, logiccircuit, and/or a data processing device. The memory may include aread-only memory (ROM), a random access memory (RAM), a flash memory, amemory card, a storage medium, and/or other storage device. That is,embodiments described in the present disclosure may be embodied andperformed on a processor, a microprocessor, a controller or a chip. Forexample, function units shown in each drawing may be embodied andperformed on a computer, a processor, a microprocessor, a controller ora chip.

Further, the decoding apparatus and the encoding apparatus to which thepresent disclosure is applied, may be included in a multimediabroadcasting transceiver, a mobile communication terminal, a home cinemavideo device, a digital cinema video device, a surveillance camera, avideo chat device, a real time communication device such as videocommunication, a mobile streaming device, a storage medium, a camcorder,a video on demand (VoD) service providing device, an over the top (OTT)video device, an Internet streaming service providing device, athree-dimensional (3D) video device, a video telephony video device, anda medical video device, and may be used to process a video signal or adata signal. For example, the over the top (OTT) video device mayinclude a game console, a Blu-ray player, an Internet access TV, a Hometheater system, a smartphone, a Tablet PC, a digital video recorder(DVR) and the like.

In addition, the processing method to which the present disclosure isapplied, may be produced in the form of a program executed by acomputer, and be stored in a computer-readable recording medium.Multimedia data having a data structure according to the presentdisclosure may also be stored in a computer-readable recording medium.The computer-readable recording medium includes all kinds of storagedevices and distributed storage devices in which computer-readable dataare stored. The computer-readable recording medium may include, forexample, a Blu-ray Disc (BD), a universal serial bus (USB), a ROM, aPROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppydisk, and an optical data storage device. Further, the computer-readablerecording medium includes media embodied in the form of a carrier wave(for example, transmission over the Internet). In addition, a bitstreamgenerated by the encoding method may be stored in a computer-readablerecording medium or transmitted through a wired or wirelesscommunication network. Additionally, the embodiments of the presentdisclosure may be embodied as a computer program product by programcodes, and the program codes may be executed on a computer by theembodiments of the present disclosure. The program codes may be storedon a computer-readable carrier.

FIG. 11 illustrates the structure of a content streaming system to whichthe present disclosure is applied.

Further, the contents streaming system to which the present disclosureis applied may largely include an encoding server, a streaming server, aweb server, a media storage, a user equipment, and a multimedia inputdevice.

The encoding server functions to compress to digital data the contentsinput from the multimedia input devices, such as the smart phone, thecamera, the camcoder and the like, to generate a bitstream, and totransmit it to the streaming server. As another example, in a case wherethe multimedia input device, such as, the smart phone, the camera, thecamcoder or the like, directly generates a bitstream, the encodingserver may be omitted. The bitstream may be generated by an encodingmethod or a bitstream generation method to which the present disclosureis applied. And the streaming server may store the bitstream temporarilyduring a process to transmit or receive the bitstream.

The streaming server transmits multimedia data to the user equipment onthe basis of a user's request through the web server, which functions asan instrument that informs a user of what service there is. When theuser requests a service which the user wants, the web server transfersthe request to the streaming server, and the streaming server transmitsmultimedia data to the user. In this regard, the contents streamingsystem may include a separate control server, and in this case, thecontrol server functions to control commands/responses betweenrespective equipments in the content streaming system.

The streaming server may receive contents from the media storage and/orthe encoding server. For example, in a case the contents are receivedfrom the encoding server, the contents may be received in real time. Inthis case, the streaming server may store the bitstream for apredetermined period of time to provide the streaming service smoothly.

For example, the user equipment may include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personaldigital assistant (PDA), a portable multimedia player (PMP), anavigation, a slate PC, a tablet PC, an ultrabook, a wearable device(e.g., a watch-type terminal (smart watch), a glass-type terminal (smartglass), a head mounted display (HMD)), a digital TV, a desktop computer,a digital signage or the like. Each of servers in the contents streamingsystem may be operated as a distributed server, and in this case, datareceived by each server may be processed in distributed manner.

Claims disclosed herein can be combined in a various way. For example,technical features of method claims of the present disclosure can becombined to be implemented or performed in an apparatus, and technicalfeatures of apparatus claims can be combined to be implemented orperformed in a method. Further, technical features of method claims andapparatus claims can be combined to be implemented or performed in anapparatus, and technical features of method claims and apparatus claimscan be combined to be implemented or performed in a method.

1. An image decoding method performed by a decoding apparatus, themethod comprising: receiving a bitstream including residual information;deriving transform coefficients for a current block based on theresidual information; and deriving residual samples for the currentblock based on the transform coefficients, wherein the deriving of thetransform coefficients comprises deriving a zero-out block related to aregion in which a significant transform coefficient may exist in thecurrent block, and wherein the zero-out block is derived based on flaginformation related to whether a multiple transform selection (MTS)using a plurality of transform kernels is applicable to the currentblock.
 2. The image decoding method of claim 1, wherein a width orheight of the zero-out block is set to 16 when the MTS is applied, andwherein the width or height of the zero-out block is set to 32 or lesswhen the MTS is not applied.
 3. The image decoding method of claim 2,wherein, when flag information related to whether a subblock transformfor performing transform on sub-blocks derived by partitioning a codingunit is applied to the current block is 1, the width or height of thezero-out block is
 16. 4. The image decoding method of claim 3, wherein,when a height of a partitioned subblock is less than 64 and a width ofthe subblock is 32, the width of the zero-out block is set to
 16. 5. Theimage decoding method of claim 3, wherein, when a width of a partitionedsubblock is less than 64 and a height of the subblock is 32, the heightof the zero-out block is set to
 16. 6. The image decoding method ofclaim 3, wherein the transform kernels are derived based on a partitiondirection of the current block and a position of a subblock to which atransform is applied.
 7. The image decoding method of claim 3, whereinthe residual information comprises last significant coefficient prefixinformation, and wherein a maximum value of the last significantcoefficient prefix information is derived based on a size of thezero-out block.
 8. The image decoding method of claim 1, wherein thezero-out block is derived for a luma component of the current block. 9.An image encoding method performed by an image encoding apparatus, themethod comprising: deriving residual samples for a current block;deriving transform coefficients based on the residual samples for thecurrent block; and encoding residual information comprising informationon the transform coefficients, wherein the deriving of the transformcoefficients comprises deriving a zero-out block related to a region inwhich a significant transform coefficient may exist in the current blockbased on whether a multiple transform selection (MTS) using a pluralityof transform kernels is applied to the current block.
 10. The imageencoding method of claim 9, wherein a width or height of the zero-outblock is set to 16 when the MTS is applied, and wherein the width orheight of the zero-out block is set to 32 or less when the MTS is notapplied.
 11. The image encoding method of claim 10, wherein, when asubblock transform for performing transform on sub-blocks derived bypartitioning a coding unit is applied to the current block, the width orheight of the zero-out block is
 16. 12. The image encoding method ofclaim 11, wherein the width of the zero-out block is set to 16 when aheight of a partitioned subblock is less than 64 and a width of thesubblock is 32, and wherein the height of the zero-out block is set to16 when the width of the subblock is less than 64 and the height of thesubblock is
 32. 13. The image encoding method of claim 11, wherein thetransform kernels are determined based on a partition direction of thecurrent block and a position of a subblock to which a transform isapplied.
 14. The image encoding method of claim 11, wherein the residualinformation comprises last significant coefficient prefix information,and wherein a maximum value of the last significant coefficient prefixinformation is derived based on a size of the zero-out block.
 15. Anon-transitory computer-readable digital storage medium that stores abitstream generated by a method, the method comprising: derivingresidual samples for a current block; deriving transform coefficientsbased on the residual samples for the current block; and encodingresidual information comprising information on the transformcoefficients to generate the bitstream, wherein the deriving of thetransform coefficients comprises deriving a zero-out block related to aregion in which a significant transform coefficient may exist in thecurrent block based on whether a multiple transform selection (MTS)using a plurality of transform kernels is applied to the current block.